Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | function test() { |
michael@0 | 5 | waitForExplicitFinish(); |
michael@0 | 6 | |
michael@0 | 7 | let tab = gBrowser.addTab(); |
michael@0 | 8 | gBrowser.selectedTab = tab; |
michael@0 | 9 | |
michael@0 | 10 | function observer(subject, topic, data) { |
michael@0 | 11 | Services.obs.removeObserver(observer, "keyword-search"); |
michael@0 | 12 | is(topic, "keyword-search", "Got keyword-search notification"); |
michael@0 | 13 | |
michael@0 | 14 | let engine = Services.search.defaultEngine; |
michael@0 | 15 | ok(engine, "Have default search engine."); |
michael@0 | 16 | is(engine, subject, "Notification subject is engine."); |
michael@0 | 17 | is("firefox health report", data, "Notification data is search term."); |
michael@0 | 18 | |
michael@0 | 19 | executeSoon(function cleanup() { |
michael@0 | 20 | gBrowser.removeTab(tab); |
michael@0 | 21 | finish(); |
michael@0 | 22 | }); |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | Services.obs.addObserver(observer, "keyword-search", false); |
michael@0 | 26 | |
michael@0 | 27 | gURLBar.value = "firefox health report"; |
michael@0 | 28 | gURLBar.handleCommand(); |
michael@0 | 29 | } |
michael@0 | 30 |