зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset b99b5f178405 (bug 1206133)
This commit is contained in:
Родитель
a1fdfe5891
Коммит
b1f5d631f7
|
@ -41,11 +41,7 @@ add_task(function* shift_left_click_test() {
|
|||
|
||||
// Wait for the initial browser to load.
|
||||
let browser = win.gBrowser.selectedBrowser;
|
||||
let destinationURL = "http://" + TEST_VALUE + "/";
|
||||
yield Promise.all([
|
||||
BrowserTestUtils.browserLoaded(browser),
|
||||
BrowserTestUtils.waitForLocationChange(win.gBrowser, destinationURL)
|
||||
]);
|
||||
yield BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
info("URL should be loaded in a new window");
|
||||
is(gURLBar.value, "", "Urlbar reverted to original value");
|
||||
|
|
|
@ -45,15 +45,12 @@ add_task(function* testAddOnBeforeCreatedWidget() {
|
|||
try {
|
||||
widgetNode.click();
|
||||
|
||||
let tempPanel = document.getElementById("customizationui-widget-panel");
|
||||
let panelShownPromise = promisePanelElementShown(window, tempPanel);
|
||||
|
||||
let shownTimeout = setTimeout(() => viewShownDeferred.reject("Panel not shown within 20s"), 20000);
|
||||
yield viewShownDeferred.promise;
|
||||
yield panelShownPromise;
|
||||
clearTimeout(shownTimeout);
|
||||
ok(true, "Found view shown");
|
||||
|
||||
let tempPanel = document.getElementById("customizationui-widget-panel");
|
||||
let panelHiddenPromise = promisePanelElementHidden(window, tempPanel);
|
||||
tempPanel.hidePopup();
|
||||
yield panelHiddenPromise;
|
||||
|
|
|
@ -82,11 +82,9 @@ var showSidebarPopup = Task.async(function*() {
|
|||
let button = document.getElementById("sidebar-button");
|
||||
let subview = document.getElementById("PanelUI-sidebar");
|
||||
|
||||
let popupShownPromise = BrowserTestUtils.waitForEvent(document, "popupshown");
|
||||
|
||||
let subviewShownPromise = subviewShown(subview);
|
||||
EventUtils.synthesizeMouseAtCenter(button, {});
|
||||
return Promise.all([subviewShownPromise, popupShownPromise]);
|
||||
return subviewShownPromise;
|
||||
});
|
||||
|
||||
// Check the sidebar widget shows the default items
|
||||
|
|
|
@ -297,34 +297,6 @@ this.BrowserTestUtils = {
|
|||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Waits for onLocationChange.
|
||||
*
|
||||
* @param {tabbrowser} tabbrowser
|
||||
* The tabbrowser to wait for the location change on.
|
||||
* @param {string} url
|
||||
* The string URL to look for. The URL must match the URL in the
|
||||
* location bar exactly.
|
||||
* @return {Promise}
|
||||
* @resolves When onLocationChange fires.
|
||||
*/
|
||||
waitForLocationChange(tabbrowser, url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let progressListener = {
|
||||
onLocationChange(aBrowser) {
|
||||
if ((url && aBrowser.currentURI.spec != url) ||
|
||||
(!url && aBrowser.currentURI.spec == "about:blank")) {
|
||||
return;
|
||||
}
|
||||
|
||||
tabbrowser.removeTabsProgressListener(progressListener);
|
||||
resolve();
|
||||
},
|
||||
};
|
||||
tabbrowser.addTabsProgressListener(progressListener);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Waits for the next browser window to open and be fully loaded.
|
||||
*
|
||||
|
|
|
@ -38,8 +38,7 @@ add_task(function* test_fill() {
|
|||
yield promiseAnchorShown;
|
||||
|
||||
let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
|
||||
"popupshown");
|
||||
|
||||
"Shown");
|
||||
anchor.click();
|
||||
yield promiseShown;
|
||||
|
||||
|
@ -48,14 +47,9 @@ add_task(function* test_fill() {
|
|||
"list.childNodes.length === 1");
|
||||
|
||||
// The button will be focused after the "transitionend" event.
|
||||
let details = document.getElementById("login-fill-details");
|
||||
let promiseListFocus = BrowserTestUtils.waitForEvent(list, "focus");
|
||||
let promiseSubviewHidden = BrowserTestUtils.waitForEvent(details,
|
||||
"transitionend",
|
||||
true,
|
||||
e => e.target == details);
|
||||
list.focus();
|
||||
yield Promise.all([promiseListFocus, promiseSubviewHidden]);
|
||||
yield new Promise(resolve => executeSoon(resolve));
|
||||
let details = document.getElementById("login-fill-details");
|
||||
let promiseSubview = BrowserTestUtils.waitForEvent(details,
|
||||
"transitionend", true,
|
||||
e => e.target == details);
|
||||
|
|
|
@ -38,8 +38,7 @@ add_task(function* test_save_change() {
|
|||
// Submit the form in the content page with the credentials from the test
|
||||
// case. This will cause the doorhanger notification to be displayed.
|
||||
let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
|
||||
"popupshown",
|
||||
(event) => event.target == PopupNotifications.panel);
|
||||
"Shown");
|
||||
yield ContentTask.spawn(browser, { username, password },
|
||||
function* ({ username, password }) {
|
||||
let doc = content.document;
|
||||
|
@ -48,15 +47,13 @@ add_task(function* test_save_change() {
|
|||
doc.getElementById("form-basic").submit();
|
||||
});
|
||||
yield promiseShown;
|
||||
let notificationElement = PopupNotifications.panel.childNodes[0];
|
||||
// Style flush to make sure binding is attached
|
||||
notificationElement.querySelector("#password-notification-password").clientTop;
|
||||
|
||||
let notificationElement = PopupNotifications.panel.childNodes[0];
|
||||
// Check the actual content of the popup notification.
|
||||
Assert.equal(notificationElement.querySelector("#password-notification-username")
|
||||
.value, username);
|
||||
.getAttribute("value"), username);
|
||||
Assert.equal(notificationElement.querySelector("#password-notification-password")
|
||||
.value, password);
|
||||
.getAttribute("value"), password);
|
||||
|
||||
// Simulate the action on the notification to request the login to be
|
||||
// saved, and wait for the data to be updated or saved based on the type
|
||||
|
|
|
@ -19,8 +19,7 @@ add_task(function* test_empty_password() {
|
|||
// Submit the form in the content page with the credentials from the test
|
||||
// case. This will cause the doorhanger notification to be displayed.
|
||||
let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
|
||||
"popupshown",
|
||||
(event) => event.target == PopupNotifications.panel);
|
||||
"popupshown");
|
||||
yield ContentTask.spawn(browser, null,
|
||||
function* () {
|
||||
let doc = content.document;
|
||||
|
@ -62,8 +61,7 @@ add_task(function* test_toggle_password() {
|
|||
// Submit the form in the content page with the credentials from the test
|
||||
// case. This will cause the doorhanger notification to be displayed.
|
||||
let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
|
||||
"popupshown",
|
||||
(event) => event.target == PopupNotifications.panel);
|
||||
"popupshown");
|
||||
yield ContentTask.spawn(browser, null,
|
||||
function* () {
|
||||
let doc = content.document;
|
||||
|
@ -100,8 +98,7 @@ add_task(function* test_checkbox_disabled_if_has_master_password() {
|
|||
// Submit the form in the content page with the credentials from the test
|
||||
// case. This will cause the doorhanger notification to be displayed.
|
||||
let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
|
||||
"popupshown",
|
||||
(event) => event.target == PopupNotifications.panel);
|
||||
"popupshown");
|
||||
|
||||
LoginTestUtils.masterPassword.enable();
|
||||
|
||||
|
|
|
@ -78,8 +78,7 @@ add_task(function* test_edit_password() {
|
|||
// Submit the form in the content page with the credentials from the test
|
||||
// case. This will cause the doorhanger notification to be displayed.
|
||||
let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
|
||||
"popupshown",
|
||||
(event) => event.target == PopupNotifications.panel);
|
||||
"popupshown");
|
||||
yield ContentTask.spawn(browser, testCase,
|
||||
function* (testCase) {
|
||||
let doc = content.document;
|
||||
|
@ -88,20 +87,18 @@ add_task(function* test_edit_password() {
|
|||
doc.getElementById("form-basic").submit();
|
||||
});
|
||||
yield promiseShown;
|
||||
let notificationElement = PopupNotifications.panel.childNodes[0];
|
||||
// Style flush to make sure binding is attached
|
||||
notificationElement.querySelector("#password-notification-password").clientTop;
|
||||
|
||||
let notificationElement = PopupNotifications.panel.childNodes[0];
|
||||
// Modify the username in the dialog if requested.
|
||||
if (testCase.usernameChangedTo) {
|
||||
notificationElement.querySelector("#password-notification-username")
|
||||
.value = testCase.usernameChangedTo;
|
||||
.setAttribute("value", testCase.usernameChangedTo);
|
||||
}
|
||||
|
||||
// Modify the password in the dialog if requested.
|
||||
if (testCase.passwordChangedTo) {
|
||||
notificationElement.querySelector("#password-notification-password")
|
||||
.value = testCase.passwordChangedTo;
|
||||
.setAttribute("value", testCase.passwordChangedTo);
|
||||
}
|
||||
|
||||
// We expect a modifyLogin notification if the final username used by the
|
||||
|
|
|
@ -69,8 +69,7 @@ add_task(function* test_edit_username() {
|
|||
// Submit the form in the content page with the credentials from the test
|
||||
// case. This will cause the doorhanger notification to be displayed.
|
||||
let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
|
||||
"popupshown",
|
||||
(event) => event.target == PopupNotifications.panel);
|
||||
"Shown");
|
||||
yield ContentTask.spawn(browser, testCase.usernameInPage,
|
||||
function* (usernameInPage) {
|
||||
let doc = content.document;
|
||||
|
@ -79,14 +78,12 @@ add_task(function* test_edit_username() {
|
|||
doc.getElementById("form-basic").submit();
|
||||
});
|
||||
yield promiseShown;
|
||||
let notificationElement = PopupNotifications.panel.childNodes[0];
|
||||
// Style flush to make sure binding is attached
|
||||
notificationElement.querySelector("#password-notification-password").clientTop;
|
||||
|
||||
let notificationElement = PopupNotifications.panel.childNodes[0];
|
||||
// Modify the username in the dialog if requested.
|
||||
if (testCase.usernameChangedTo) {
|
||||
notificationElement.querySelector("#password-notification-username")
|
||||
.value = testCase.usernameChangedTo;
|
||||
.setAttribute("value", testCase.usernameChangedTo);
|
||||
}
|
||||
|
||||
// We expect a modifyLogin notification if the final username used by the
|
||||
|
|
Загрузка…
Ссылка в новой задаче