alert =
+ do_CreateInstance(ALERT_NOTIFICATION_CONTRACTID);
+ NS_ENSURE_TRUE_VOID(alert);
+ rv = alert->Init(alertName, iconUrl, mTitle, mBody,
+ true,
+ uniqueCookie,
+ DirectionToString(mDir),
+ mLang,
+ mDataAsBase64,
+ GetPrincipal(),
+ inPrivateBrowsing);
+ NS_ENSURE_SUCCESS_VOID(rv);
+ alertService->ShowAlert(alert, alertObserver);
}
/* static */ bool
diff --git a/dom/tests/browser/browser_test_toolbars_visibility.js b/dom/tests/browser/browser_test_toolbars_visibility.js
index 77c15e67bd66..90e724b02e2d 100644
--- a/dom/tests/browser/browser_test_toolbars_visibility.js
+++ b/dom/tests/browser/browser_test_toolbars_visibility.js
@@ -98,15 +98,15 @@ function testNonDefaultContentToolbars(toolbars) {
function testNonDefaultChromeToolbars(toolbars) {
// None of the toolbars should be visible if hidden with chrome privileges
ok(!toolbars.locationbar,
- "locationbar should be visible on default window.open()");
+ "locationbar should not be visible with location=no");
ok(!toolbars.menubar,
- "menubar be visible on default window.open()");
+ "menubar should not be visible with menubar=no");
ok(!toolbars.personalbar,
- "personalbar should be visible on default window.open()");
+ "personalbar should not be visible with personalbar=no");
ok(!toolbars.statusbar,
- "statusbar should be visible on default window.open()");
+ "statusbar should not be visible with status=no");
ok(!toolbars.toolbar,
- "toolbar should be visible on default window.open()");
+ "toolbar should not be visible with toolbar=no");
}
/**
@@ -147,7 +147,42 @@ add_task(function*() {
let popupToolbars = yield getToolbarsFromBrowserContent(popupBrowser);
testNonDefaultContentToolbars(popupToolbars);
- // Cleanup
+ // Ensure that chrome toolbars agree with content
+ let chromeToolbars = getToolbarsFromWindowChrome(popupWindow);
+ testNonDefaultContentToolbars(chromeToolbars);
+
+ // Close the new window
+ yield BrowserTestUtils.closeWindow(popupWindow);
+ });
+});
+
+/**
+ * Ensure that toolbars of a window opened to about:blank in the content context
+ * have the correct visibility.
+ *
+ * A window opened with "location=no, personalbar=no, toolbar=no, scrollbars=no,
+ * menubar=no, status=no", should only have location visible.
+ */
+add_task(function*() {
+ yield BrowserTestUtils.withNewTab({
+ gBrowser,
+ url: CONTENT_PAGE,
+ }, function*(browser) {
+ // Open a blank window with toolbars hidden
+ let winPromise = BrowserTestUtils.waitForNewWindow();
+ yield BrowserTestUtils.synthesizeMouseAtCenter("#winOpenNoURLNonDefault", {}, browser);
+ let popupWindow = yield winPromise;
+
+ // No need to wait for this window to load, since it's loading about:blank
+ let popupBrowser = popupWindow.gBrowser.selectedBrowser;
+ let popupToolbars = yield getToolbarsFromBrowserContent(popupBrowser);
+ testNonDefaultContentToolbars(popupToolbars);
+
+ // Ensure that chrome toolbars agree with content
+ let chromeToolbars = getToolbarsFromWindowChrome(popupWindow);
+ testNonDefaultContentToolbars(chromeToolbars);
+
+ // Close the new window
yield BrowserTestUtils.closeWindow(popupWindow);
});
});
diff --git a/dom/tests/browser/test_new_window_from_content_child.html b/dom/tests/browser/test_new_window_from_content_child.html
index 5d2733ba180a..e5da60b42b28 100644
--- a/dom/tests/browser/test_new_window_from_content_child.html
+++ b/dom/tests/browser/test_new_window_from_content_child.html
@@ -7,6 +7,7 @@
Open a new window via window.open with default features.
Open a new window via window.open with non-default features.
Open a new window via window.open with dialog=1.
+ Open a blank new window via window.open with non-default features.
Open a new window via target="_blank".