Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(973)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/resources/testharness-helpers.js

Issue 1926813004: Replace assert_promise_rejects with upstream promise_rejects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update testharness.js and rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/resources/testharness-helpers.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/resources/testharness-helpers.js b/third_party/WebKit/LayoutTests/http/tests/resources/testharness-helpers.js
index 12960e30ac8ce9423dc11c7bea9841cec950f012..9d84557c0555a6592cdd0ce9fa55ee09af1fd6e8 100644
--- a/third_party/WebKit/LayoutTests/http/tests/resources/testharness-helpers.js
+++ b/third_party/WebKit/LayoutTests/http/tests/resources/testharness-helpers.js
@@ -5,33 +5,6 @@
* environments, so code should for example not rely on the DOM.
*/
-// Returns a promise that fulfills after the provided |promise| is fulfilled.
-// The |test| succeeds only if |promise| rejects with an exception matching
-// |code|. Accepted values for |code| follow those accepted for assert_throws().
-// The optional |description| describes the test being performed.
-//
-// E.g.:
-// assert_promise_rejects(
-// new Promise(...), // something that should throw an exception.
-// 'NotFoundError',
-// 'Should throw NotFoundError.');
-//
-// assert_promise_rejects(
-// new Promise(...),
-// new TypeError(),
-// 'Should throw TypeError');
-function assert_promise_rejects(promise, code, description) {
- return promise.then(
- function() {
- throw 'assert_promise_rejects: ' + description + ' Promise did not reject.';
- },
- function(e) {
- if (code !== undefined) {
- assert_throws(code, function() { throw e; }, description);
- }
- });
-}
-
// Asserts that |object| that is an instance of some interface has the attribute
// |attribute_name| following the conditions specified by WebIDL, but it's
// acceptable that the attribute |attribute_name| is an own property of the

Powered by Google App Engine
This is Rietveld 408576698