From b05276ed8264e5a71f20a7068690ba2a414ee6d8 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 7 Mar 2015 16:49:32 +0000 Subject: Reload content scripts after install/update. This is @mrmr1993's work from #1041. Reload content scripts when vimium is installed or updates. (@mrmr1993: The automatic merge was really messy (or, at least, I couldn't figure out what was going on). Since the bulk of #1041 was actually quite compact, I took the liberty of just copying it in. Hope you don't mind.) --- tests/dom_tests/dom_tests.coffee | 4 ++-- tests/unit_tests/test_chrome_stubs.coffee | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/dom_tests/dom_tests.coffee b/tests/dom_tests/dom_tests.coffee index 600616a9..ff95d3f4 100644 --- a/tests/dom_tests/dom_tests.coffee +++ b/tests/dom_tests/dom_tests.coffee @@ -542,7 +542,7 @@ context "Mode badges", should "have an I badge in insert mode by focus", -> document.getElementById("first").focus() - assert.isTrue chromeMessages[0].badge == "I" + assert.isTrue chromeMessages[1].badge == "I" should "have no badge after leaving insert mode by focus", -> document.getElementById("first").focus() @@ -575,5 +575,5 @@ context "Mode badges", passKeys: "" document.getElementById("first").focus() - assert.isTrue chromeMessages[0].badge == "" + assert.isTrue chromeMessages[1].badge == "" diff --git a/tests/unit_tests/test_chrome_stubs.coffee b/tests/unit_tests/test_chrome_stubs.coffee index c61d7246..bc50521a 100644 --- a/tests/unit_tests/test_chrome_stubs.coffee +++ b/tests/unit_tests/test_chrome_stubs.coffee @@ -16,6 +16,8 @@ exports.chrome = addListener: () -> true onMessage: addListener: () -> true + onInstalled: + addListener: -> tabs: onSelectionChanged: -- cgit v1.2.3