michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: let tab = gBrowser.addTab(); michael@0: gBrowser.selectedTab = tab; michael@0: michael@0: function observer(subject, topic, data) { michael@0: Services.obs.removeObserver(observer, "keyword-search"); michael@0: is(topic, "keyword-search", "Got keyword-search notification"); michael@0: michael@0: let engine = Services.search.defaultEngine; michael@0: ok(engine, "Have default search engine."); michael@0: is(engine, subject, "Notification subject is engine."); michael@0: is("firefox health report", data, "Notification data is search term."); michael@0: michael@0: executeSoon(function cleanup() { michael@0: gBrowser.removeTab(tab); michael@0: finish(); michael@0: }); michael@0: } michael@0: michael@0: Services.obs.addObserver(observer, "keyword-search", false); michael@0: michael@0: gURLBar.value = "firefox health report"; michael@0: gURLBar.handleCommand(); michael@0: } michael@0: