mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 969376 - fix all the tests for Australis panel to not go orange because of promises and weirdness, r=jaws
This commit is contained in:
parent
6ef383e540
commit
fe5d0d1950
@ -4,8 +4,6 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
|
||||
const isOSX = (Services.appinfo.OS === "Darwin");
|
||||
|
||||
// Right-click on the home button should
|
||||
|
@ -4,6 +4,19 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
let openUILinkInCalled = false;
|
||||
let expectOpenUILinkInCall = false;
|
||||
this.originalOpenUILinkIn = openUILinkIn;
|
||||
openUILinkIn = (aUrl, aWhichTab) => {
|
||||
is(aUrl, Services.search.defaultEngine.searchForm, "Search page should be requested to open.");
|
||||
is(aWhichTab, "current", "Should use the current tab for the search page.");
|
||||
openUILinkInCalled = true;
|
||||
if (!expectOpenUILinkInCall) {
|
||||
ok(false, "OpenUILink in was called when it shouldn't have been.");
|
||||
}
|
||||
};
|
||||
logActiveElement();
|
||||
|
||||
// Ctrl+K should open the menu panel and focus the search bar if the search bar is in the panel.
|
||||
add_task(function() {
|
||||
let searchbar = document.getElementById("searchbar");
|
||||
@ -88,28 +101,29 @@ add_task(function() {
|
||||
|
||||
// Ctrl+K should open the search page if the search bar has been customized out.
|
||||
add_task(function() {
|
||||
this.originalOpenUILinkIn = openUILinkIn;
|
||||
try {
|
||||
expectOpenUILinkInCall = true;
|
||||
CustomizableUI.removeWidgetFromArea("search-container");
|
||||
let placement = CustomizableUI.getPlacementOfWidget("search-container");
|
||||
is(placement, null, "Search container should be in palette");
|
||||
|
||||
let openUILinkInCalled = false;
|
||||
openUILinkIn = (aUrl, aWhichTab) => {
|
||||
is(aUrl, Services.search.defaultEngine.searchForm, "Search page should be requested to open.");
|
||||
is(aWhichTab, "current", "Should use the current tab for the search page.");
|
||||
openUILinkInCalled = true;
|
||||
};
|
||||
openUILinkInCalled = false;
|
||||
|
||||
sendWebSearchKeyCommand();
|
||||
yield waitForCondition(function() openUILinkInCalled);
|
||||
ok(openUILinkInCalled, "The search page should have been opened.")
|
||||
expectOpenUILinkInCall = false;
|
||||
} catch (e) {
|
||||
ok(false, e);
|
||||
}
|
||||
openUILinkIn = this.originalOpenUILinkIn;
|
||||
CustomizableUI.reset();
|
||||
});
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
openUILinkIn = this.originalOpenUILinkIn;
|
||||
delete this.originalOpenUILinkIn;
|
||||
});
|
||||
|
||||
function sendWebSearchKeyCommand() {
|
||||
if (Services.appinfo.OS === "Darwin")
|
||||
EventUtils.synthesizeKey("k", { accelKey: true });
|
||||
@ -119,7 +133,10 @@ function sendWebSearchKeyCommand() {
|
||||
|
||||
function logActiveElement() {
|
||||
let element = document.activeElement;
|
||||
info("Active element: " + element ?
|
||||
element + " (" + element.localName + "#" + element.id + "." + [...element.classList].join(".") + ")" :
|
||||
"null");
|
||||
let str = "";
|
||||
while (element && element.parentNode) {
|
||||
str = " (" + element.localName + "#" + element.id + "." + [...element.classList].join(".") + ") >" + str;
|
||||
element = element.parentNode;
|
||||
}
|
||||
info("Active element: " + element ? str : "null");
|
||||
}
|
||||
|
@ -5,7 +5,6 @@
|
||||
"use strict";
|
||||
|
||||
let Preferences = Cu.import("resource://gre/modules/Preferences.jsm", {}).Preferences;
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
|
||||
let tmp = {};
|
||||
Cu.import("resource://gre/modules/FxAccounts.jsm", tmp);
|
||||
|
Loading…
Reference in New Issue
Block a user