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

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: 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
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..8851f4687d287472dce07914da8a4af644831a96
--- /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]);
+ });
nhiroki 2014/12/08 08:01:09 ';' is not necessary.
Kunihiko Sakamoto 2014/12/08 08:34:10 Oops, done.
+ .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>

Powered by Google App Engine
This is Rietveld 408576698