mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 18:47:53 +00:00
Bug 890690 followup: simplify test
This commit is contained in:
parent
8ecbcfc2a9
commit
7df07435cc
@ -282,25 +282,23 @@ let gTests = [
|
||||
Services.search.defaultEngine = currEngine;
|
||||
});
|
||||
|
||||
let needle = "Search for something awesome.";
|
||||
|
||||
// Ready to execute the tests!
|
||||
promiseBrowserAttributes(gBrowser.selectedTab).then(function() {
|
||||
let document = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let searchText = document.getElementById("searchText");
|
||||
let needle = "Search for something awesome.";
|
||||
let document = gBrowser.selectedTab.linkedBrowser.contentDocument;
|
||||
let searchText = document.getElementById("searchText");
|
||||
|
||||
waitForLoad(function() {
|
||||
let loadedText = gBrowser.contentDocument.body.textContent;
|
||||
ok(loadedText, "search page loaded");
|
||||
is(loadedText, "searchterms=" + escape(needle.replace(/\s/g, "+")),
|
||||
"Search text should arrive correctly");
|
||||
deferred.resolve();
|
||||
});
|
||||
|
||||
searchText.value = needle;
|
||||
searchText.focus();
|
||||
EventUtils.synthesizeKey("VK_RETURN", {});
|
||||
waitForLoad(function() {
|
||||
let loadedText = gBrowser.contentDocument.body.textContent;
|
||||
ok(loadedText, "search page loaded");
|
||||
is(loadedText, "searchterms=" + escape(needle.replace(/\s/g, "+")),
|
||||
"Search text should arrive correctly");
|
||||
deferred.resolve();
|
||||
});
|
||||
|
||||
searchText.value = needle;
|
||||
searchText.focus();
|
||||
EventUtils.synthesizeKey("VK_RETURN", {});
|
||||
};
|
||||
Services.obs.addObserver(searchObserver, "browser-search-engine-modified", false);
|
||||
registerCleanupFunction(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user