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

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

Issue 265943003: Add blink-side binding code for navigator.serviceWorker.current (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: +title Created 6 years, 7 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);
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698