Backed out changeset c9c01c06908a (bug 1242505)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sun, 28 May 2017 11:31:06 +0200
changeset 585751 5703711e4ee5c2b00e8f8fc9fcaefbcf6a15fdf5
parent 585750 824f44aad5d7bd26c59aaf301ce60188b5466cef
child 585752 9dbe428fc209988be73d2a4bbc3c890811310d3d
push id61188
push usermaglione.k@gmail.com
push dateSun, 28 May 2017 22:11:50 +0000
bugs1242505
milestone55.0a1
backs outc9c01c06908add6e1631121bed3d0cfaa8feeefa
Backed out changeset c9c01c06908a (bug 1242505)
testing/mochitest/tests/browser/browser.ini
testing/mochitest/tests/browser/browser_fail_add_task_uncaught_rejection.js
testing/mochitest/tests/browser/browser_fail_uncaught_rejection.js
testing/mochitest/tests/browser/browser_fail_uncaught_rejection_expected.js
testing/mochitest/tests/browser/browser_fail_uncaught_rejection_expected_multi.js
testing/mochitest/tests/browser/browser_uncaught_rejection_expected.js
--- a/testing/mochitest/tests/browser/browser.ini
+++ b/testing/mochitest/tests/browser/browser.ini
@@ -5,39 +5,35 @@ support-files =
 [browser_add_task.js]
 [browser_async.js]
 [browser_browserLoaded_content_loaded.js]
 [browser_BrowserTestUtils.js]
 support-files =
   dummy.html
 [browser_fail.js]
 [browser_fail_add_task.js]
-[browser_fail_add_task_uncaught_rejection.js]
 [browser_fail_async.js]
 [browser_fail_if.js]
 fail-if = true
 [browser_fail_throw.js]
 [browser_fail_timeout.js]
 skip-if = true # Disabled beacuse it takes too long (bug 1178959)
 [browser_fail_uncaught_rejection.js]
-[browser_fail_uncaught_rejection_expected.js]
-[browser_fail_uncaught_rejection_expected_multi.js]
 [browser_fail_unexpectedTimeout.js]
 skip-if = true # Disabled beacuse it takes too long (bug 1178959)
 [browser_getTestFile.js]
 support-files =
   test-dir/*
   waitForFocusPage.html
 [browser_head.js]
 [browser_pass.js]
 [browser_parameters.js]
 [browser_popupNode.js]
 [browser_popupNode_check.js]
 [browser_privileges.js]
 [browser_requestLongerTimeout.js]
 skip-if = true # Disabled beacuse it takes too long (bug 1178959)
 [browser_sanityException.js]
 [browser_sanityException2.js]
-[browser_uncaught_rejection_expected.js]
 [browser_waitForFocus.js]
 skip-if = (os == "win" && e10s && debug)
 [browser_zz_fail_openwindow.js]
 skip-if = true # this catches outside of the main loop to find an extra window
deleted file mode 100644
--- a/testing/mochitest/tests/browser/browser_fail_add_task_uncaught_rejection.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-setExpectedFailuresForSelfTest(8);
-
-// Keep "JSMPromise" separate so "Promise" still refers to native Promises.
-let JSMPromise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
-
-async function rejectOnNextTick(error) {
-  await Promise.resolve();
-
-  Promise.reject(error);
-  JSMPromise.reject(error);
-}
-
-add_task(function failWithoutError() {
-  yield rejectOnNextTick(undefined);
-});
-
-add_task(function failWithString() {
-  yield rejectOnNextTick("This is a string");
-});
-
-add_task(function failWithInt() {
-  yield rejectOnNextTick(42);
-});
-
-// This one should display a stack trace
-add_task(function failWithError() {
-  yield rejectOnNextTick(new Error("This is an error"));
-});
--- a/testing/mochitest/tests/browser/browser_fail_uncaught_rejection.js
+++ b/testing/mochitest/tests/browser/browser_fail_uncaught_rejection.js
@@ -1,19 +1,6 @@
-setExpectedFailuresForSelfTest(3);
-
-// Keep "JSMPromise" separate so "Promise" still refers to native Promises.
-let JSMPromise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
+setExpectedFailuresForSelfTest(1);
 
 function test() {
+  Components.utils.import("resource://gre/modules/Promise.jsm", this);
   Promise.reject(new Error("Promise rejection."));
-  JSMPromise.reject(new Error("Promise.jsm rejection."));
-  (async () => {
-    throw "Synchronous rejection from async function.";
-  })();
-
-  // The following rejections are caught, so they won't result in failures.
-  Promise.reject(new Error("Promise rejection.")).catch(() => {});
-  JSMPromise.reject(new Error("Promise.jsm rejection.")).catch(() => {});
-  (async () => {
-    throw "Synchronous rejection from async function.";
-  })().catch(() => {});
 }
deleted file mode 100644
--- a/testing/mochitest/tests/browser/browser_fail_uncaught_rejection_expected.js
+++ /dev/null
@@ -1,10 +0,0 @@
-setExpectedFailuresForSelfTest(1);
-
-// The test will fail because there is only one of two expected rejections.
-Cu.import("resource://testing-common/PromiseTestUtils.jsm", this);
-PromiseTestUtils.expectUncaughtRejection(/Promise rejection./);
-PromiseTestUtils.expectUncaughtRejection(/Promise rejection./);
-
-function test() {
-  Promise.reject(new Error("Promise rejection."));
-}
deleted file mode 100644
--- a/testing/mochitest/tests/browser/browser_fail_uncaught_rejection_expected_multi.js
+++ /dev/null
@@ -1,9 +0,0 @@
-setExpectedFailuresForSelfTest(1);
-
-// The test will fail because an expected uncaught rejection is actually caught.
-Cu.import("resource://testing-common/PromiseTestUtils.jsm", this);
-PromiseTestUtils.expectUncaughtRejection(/Promise rejection./);
-
-function test() {
-  Promise.reject(new Error("Promise rejection.")).catch(() => {});
-}
deleted file mode 100644
--- a/testing/mochitest/tests/browser/browser_uncaught_rejection_expected.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Keep "JSMPromise" separate so "Promise" still refers to native Promises.
-let JSMPromise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
-
-Cu.import("resource://testing-common/PromiseTestUtils.jsm", this);
-PromiseTestUtils.whitelistRejectionsGlobally(/Whitelisted rejection./);
-PromiseTestUtils.expectUncaughtRejection(/Promise.jsm rejection./);
-PromiseTestUtils.expectUncaughtRejection(/Promise.jsm rejection./);
-PromiseTestUtils.expectUncaughtRejection(/Promise rejection./);
-PromiseTestUtils.expectUncaughtRejection(/Promise rejection./);
-
-function test() {
-  Promise.reject(new Error("Promise rejection."));
-  Promise.reject(new Error("Promise rejection."));
-  Promise.reject(new Error("Whitelisted rejection."));
-  JSMPromise.reject(new Error("Promise.jsm rejection."));
-  JSMPromise.reject(new Error("Promise.jsm rejection."));
-  JSMPromise.reject(new Error("Whitelisted rejection."));
-}