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

Unified Diff: LayoutTests/http/tests/serviceworker/clients-getall.html

Issue 778703004: Implement ServiceWorkerClient attributes [3/3] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@properties-step1
Patch Set: Protect by a runtime flag Created 6 years 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/clients-getall-worker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/serviceworker/clients-getall.html
diff --git a/LayoutTests/http/tests/serviceworker/clients-getall.html b/LayoutTests/http/tests/serviceworker/clients-getall.html
new file mode 100644
index 0000000000000000000000000000000000000000..7bc2d2834081b1d25b14a26819618d251bbe5fb2
--- /dev/null
+++ b/LayoutTests/http/tests/serviceworker/clients-getall.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Service Worker: ServiceWorkerClient.getAll</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.js"></script>
+<script>
+var scope = 'resources/blank.html?clients-getAll';
+var t = async_test('Test ServiceWorkerClient.getAll()');
+t.step(function() {
+ service_worker_unregister_and_register(
+ t, 'resources/clients-getall-worker.js', scope)
+ .then(function(registration) {
+ return wait_for_state(t, registration.installing, 'activated');
+ })
+ .then(function() { return with_iframe(scope + '#1'); })
+ .then(function(frame1) {
+ frame1.focus();
+ return with_iframe(scope + '#2');
+ })
+ .then(function(frame2) {
+ var channel = new MessageChannel();
+ channel.port1.onmessage = t.step_func(onMessage);
+ frame2.contentWindow.navigator.serviceWorker.controller.postMessage(
+ {port:channel.port2}, [channel.port2]);
+ })
+ .catch(unreached_rejection(t));
+ });
+
+var expected = [
+ /* visibilityState, focused, url, frameType */
+ ['visible', true, new URL(scope + '#1', location).toString(), 'nested'],
+ ['visible', false, new URL(scope + '#2', location).toString(), 'nested']
+];
+
+function onMessage(e) {
+ assert_equals(e.data.length, 2);
+ assert_array_equals(e.data[0], expected[0]);
+ assert_array_equals(e.data[1], expected[1]);
+ service_worker_unregister_and_done(t, scope);
+}
+</script>
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/clients-getall-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698