docshell/test/browser/browser_search_notification.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 function test() {
     5   waitForExplicitFinish();
     7   let tab = gBrowser.addTab();
     8   gBrowser.selectedTab = tab;
    10   function observer(subject, topic, data) {
    11     Services.obs.removeObserver(observer, "keyword-search");
    12     is(topic, "keyword-search", "Got keyword-search notification");
    14     let engine = Services.search.defaultEngine;
    15     ok(engine, "Have default search engine.");
    16     is(engine, subject, "Notification subject is engine.");
    17     is("firefox health report", data, "Notification data is search term.");
    19     executeSoon(function cleanup() {
    20       gBrowser.removeTab(tab);
    21       finish();
    22     });
    23   }
    25   Services.obs.addObserver(observer, "keyword-search", false);
    27   gURLBar.value = "firefox health report";
    28   gURLBar.handleCommand();
    29 }

mercurial