bug 1244544 - remove uiOnlyAllowOneWindow.js since nsIDOMWindow/mozIDOMWindowProxy cannot be mocked in JS. r=mhowell
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 25 May 2016 00:09:25 -0700
changeset 298855 18083cdf9caa7bd16e76bf1a2afc25fdc333d29e
parent 298854 97b22d33cd789520910ef8dfc81374ab53c62134
child 298856 445f4347135cd17ff0ce60ffc157a9be3ed5e3a3
push id77344
push userrstrong@mozilla.com
push dateWed, 25 May 2016 07:10:13 +0000
treeherdermozilla-inbound@445f4347135c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhowell
bugs1244544
milestone49.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 1244544 - remove uiOnlyAllowOneWindow.js since nsIDOMWindow/mozIDOMWindowProxy cannot be mocked in JS. r=mhowell
toolkit/mozapps/update/tests/unit_aus_update/uiOnlyAllowOneWindow.js
toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
deleted file mode 100644
--- a/toolkit/mozapps/update/tests/unit_aus_update/uiOnlyAllowOneWindow.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Components.utils.import("resource://testing-common/MockRegistrar.jsm");
-
-/**
- * Test that nsIUpdatePrompt doesn't display UI for showUpdateInstalled and
- * showUpdateAvailable when there is already an application update window open.
- */
-
-function run_test() {
-  setupTestCommon();
-
-  debugDump("testing nsIUpdatePrompt notifications should not be seen when " +
-            "there is already an application update window open");
-
-  Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
-
-  let windowWatcherCID =
-    MockRegistrar.register("@mozilla.org/embedcomp/window-watcher;1",
-                           WindowWatcher);
-  let windowMediatorCID =
-    MockRegistrar.register("@mozilla.org/appshell/window-mediator;1",
-                           WindowMediator);
-  do_register_cleanup(() => {
-    MockRegistrar.unregister(windowWatcherCID);
-    MockRegistrar.unregister(windowMediatorCID);
-  });
-
-  standardInit();
-
-  debugDump("testing showUpdateInstalled should not call openWindow");
-  Services.prefs.setBoolPref(PREF_APP_UPDATE_SHOW_INSTALLED_UI, true);
-
-  gCheckFunc = check_showUpdateInstalled;
-  gUP.showUpdateInstalled();
-  // Report a successful check after the call to showUpdateInstalled since it
-  // didn't throw and otherwise it would report no tests run.
-  Assert.ok(true,
-            "calling showUpdateInstalled should not attempt to open a window");
-
-  debugDump("testing showUpdateAvailable should not call openWindow");
-  writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
-  let patches = getLocalPatchString(null, null, null, null, null, null,
-                                    STATE_FAILED);
-  let updates = getLocalUpdateString(patches);
-  writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
-  writeStatusFile(STATE_FAILED);
-  reloadUpdateManagerData();
-
-  gCheckFunc = check_showUpdateAvailable;
-  let update = gUpdateManager.activeUpdate;
-  gUP.showUpdateAvailable(update);
-  // Report a successful check after the call to showUpdateAvailable since it
-  // didn't throw and otherwise it would report no tests run.
-  Assert.ok(true,
-            "calling showUpdateAvailable should not attempt to open a window");
-
-  doTestFinish();
-}
-
-function check_showUpdateInstalled() {
-  do_throw("showUpdateInstalled should not have called openWindow!");
-}
-
-function check_showUpdateAvailable() {
-  do_throw("showUpdateAvailable should not have called openWindow!");
-}
-
-const WindowWatcher = {
-  openWindow: function(aParent, aUrl, aName, aFeatures, aArgs) {
-    gCheckFunc();
-  },
-
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowWatcher])
-};
-
-const WindowMediator = {
-  getMostRecentWindow: function(aWindowType) {
-    return { getInterface: XPCOMUtils.generateQI([Ci.nsIDOMWindow]) };
-  },
-
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowMediator])
-};
--- a/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
+++ b/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
@@ -26,19 +26,16 @@ tail =
 skip-if = buildapp == "mulet" || toolkit == 'gonk'
 reason = custom nsIUpdatePrompt
 [downloadInterruptedByOfflineRetry.js]
 [downloadFileTooBig_gonk.js]
 skip-if = toolkit != 'gonk'
 [uiSilentPref.js]
 skip-if = toolkit == 'gonk'
 reason = custom nsIUpdatePrompt
-[uiOnlyAllowOneWindow.js]
-skip-if = true
-reason = mozIDOMWindowProxy cannot be mocked in JS
 ;skip-if = toolkit == 'gonk'
 ;reason = custom nsIUpdatePrompt
 [uiUnsupportedAlreadyNotified.js]
 skip-if = toolkit == 'gonk'
 reason = custom nsIUpdatePrompt
 [uiAutoPref.js]
 skip-if = toolkit == 'gonk'
 reason = custom nsIUpdatePrompt