Bug 908534 - test that chromeUI notification is shown for about:support when opened as a new tab, r=ttaubert
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 11 Jun 2014 11:56:30 +0100
changeset 188320 2bd196dc1b2c631fdc80ab04ff75df077371aeb4
parent 188319 dfe571731a0d77b494ed8289ea988ddb28a02b8f
child 188321 281e6fc177c45776ee98869d9e810d45a9de26d8
push id26951
push useremorley@mozilla.com
push dateThu, 12 Jun 2014 14:07:43 +0000
treeherdermozilla-central@4f98802de6ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs908534
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 908534 - test that chromeUI notification is shown for about:support when opened as a new tab, r=ttaubert
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_aboutSupport_newtab_security_state.js
browser/base/content/test/general/head.js
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -82,16 +82,17 @@ support-files =
   xul_tooltiptext.xhtml
 
 [browser_URLBarSetURI.js]
 skip-if = (os == "linux" || os == "mac") && debug # bug 970052, bug 970053
 [browser_aboutAccounts.js]
 skip-if = os == "linux" # Bug 958026
 support-files =
   content_aboutAccounts.js
+[browser_aboutSupport_newtab_security_state.js]
 [browser_aboutHealthReport.js]
 skip-if = os == "linux" # Bug 924307
 [browser_aboutHome.js]
 skip-if = e10s # Bug ?????? - no about:home support yet
 [browser_aboutSyncProgress.js]
 [browser_addKeywordSearch.js]
 [browser_alltabslistener.js]
 skip-if = os == "linux" || e10s # Linux: Intermittent failures, bug 951680; e10s: Bug ?????? - notifications don't work correctly.
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/general/browser_aboutSupport_newtab_security_state.js
@@ -0,0 +1,20 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+add_task(function* checkIdentityOfAboutSupport() {
+  let tab = gBrowser.loadOneTab("about:support", {
+    referrerURI: null,
+    inBackground: false,
+    allowThirdPartyFixup: false,
+    relatedToCurrent: false,
+    skipAnimation: true,
+    disableMCB: false
+  });
+
+  yield promiseTabLoaded(tab);
+  let identityBox = document.getElementById("identity-box");
+  is(identityBox.className, gIdentityHandler.IDENTITY_MODE_CHROMEUI,
+     "Should know that we're chrome.");
+  gBrowser.removeTab(tab);
+});
+
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -221,16 +221,22 @@ function whenNewTabLoaded(aWindow, aCall
 function whenTabLoaded(aTab, aCallback) {
   let browser = aTab.linkedBrowser;
   browser.addEventListener("load", function onLoad() {
     browser.removeEventListener("load", onLoad, true);
     executeSoon(aCallback);
   }, true);
 }
 
+function promiseTabLoaded(aTab) {
+  let deferred = Promise.defer();
+  whenTabLoaded(aTab, deferred.resolve);
+  return deferred.promise;
+}
+
 function addVisits(aPlaceInfo, aCallback) {
   let places = [];
   if (aPlaceInfo instanceof Ci.nsIURI) {
     places.push({ uri: aPlaceInfo });
   } else if (Array.isArray(aPlaceInfo)) {
     places = places.concat(aPlaceInfo);
   } else {
     places.push(aPlaceInfo);