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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/test-helpers.js

Issue 263903005: Fork of https://codereview.chromium.org/265943003 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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: LayoutTests/http/tests/serviceworker/resources/test-helpers.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
index c4df888078ec3df7853796bf91ca1b8b14595198..83b0391ab032ac27464d413e7b397e45f66e686b 100644
--- a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
+++ b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
@@ -10,9 +10,8 @@ function service_worker_test(url, description) {
messageChannel.port1.onmessage = t.step_func(onMessage);
worker.postMessage({port:messageChannel.port2}, [messageChannel.port2]);
}),
- t.step_func(function(reason) {
- assert_unreached('Registration should succeed, but failed: ' + reason.name);
- }));
+ unreached_rejection(t, 'Registration should succeed, but failed')
+ );
function onMessage(e) {
assert_equals(e.data, 'pass');
@@ -31,3 +30,10 @@ function unreached_func(test, desc) {
assert_unreached(desc);
});
}
+
+// Rejection-specific helper that provides more details
+function unreached_rejection(test, prefix) {
+ return test.step_func(function(reason) {
+ assert_unreached(prefix + ': ' + reason.name);
+ });
+}
« no previous file with comments | « LayoutTests/http/tests/serviceworker/resources/blank.html ('k') | LayoutTests/http/tests/serviceworker/resources/testutils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698