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

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: rebased cached properties access tests 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 d15c79208959436e8bb4e2e30575349d0a665b3a..5a98fcbc1ed7b950e4c75dea83933f25331cef86 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');
@@ -38,3 +37,13 @@ function unreached_rejection(test, prefix) {
assert_unreached(prefix + ': ' + reason.name);
});
}
+
+// FIXME: Clean up the iframe when the test completes.
+function with_iframe(url, f) {
+ var frame = document.createElement('iframe');
+ frame.src = url;
+ frame.onload = function() {
+ f(frame);
+ };
+ document.body.appendChild(frame);
+}

Powered by Google App Engine
This is Rietveld 408576698