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

Side by Side Diff: LayoutTests/http/tests/serviceworker/chromium/resources/clients-openwindow.js

Issue 866043005: [ServiceWorker] Tests for WindowClient.focus(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sw_openwindow_tests
Patch Set: review comment Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/chromium/resources/notificationclick-can-focus.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // This helper will setup a small test framework that will use TESTS and run 1 // This helper will setup a small test framework that will use TESTS and run
2 // them iteratively and call self.postMessage('quit') when done. 2 // them sequentially and call self.postMessage('quit') when done.
3 // This helper also exposes |client|, |postMessage()|, |runNextTestOrQuit()|, 3 // This helper also exposes |client|, |postMessage()|, |runNextTestOrQuit()|,
4 // |synthesizeNotificationClick()| and |initialize()|. 4 // |synthesizeNotificationClick()| and |initialize()|.
5 importScripts('sw-test-helpers.js'); 5 importScripts('sw-test-helpers.js');
6 6
7 var TESTS = [ 7 var TESTS = [
8 function testWithNoNotificationClick() { 8 function testWithNoNotificationClick() {
9 clients.openWindow('/').catch(function(e) { 9 clients.openWindow('/').catch(function(e) {
10 self.postMessage('openWindow() can\'t open a window without a user i nteraction'); 10 self.postMessage('openWindow() can\'t open a window without a user i nteraction');
11 self.postMessage('openWindow() error is ' + e.name); 11 self.postMessage('openWindow() error is ' + e.name);
12 }).then(runNextTestOrQuit); 12 }).then(runNextTestOrQuit);
(...skipping 25 matching lines...) Expand all
38 self.postMessage(' url: ' + c.url); 38 self.postMessage(' url: ' + c.url);
39 self.postMessage(' visibilityState: ' + c.visibilityState); 39 self.postMessage(' visibilityState: ' + c.visibilityState);
40 self.postMessage(' focused: ' + c.focused); 40 self.postMessage(' focused: ' + c.focused);
41 self.postMessage(' frameType: ' + c.frameType); 41 self.postMessage(' frameType: ' + c.frameType);
42 }).then(runNextTestOrQuit); 42 }).then(runNextTestOrQuit);
43 }); 43 });
44 } 44 }
45 ]; 45 ];
46 46
47 self.onmessage = function(e) { 47 self.onmessage = function(e) {
48 if (e.data == "start") { 48 if (e.data == 'start') {
49 initialize().then(runNextTestOrQuit); 49 initialize().then(runNextTestOrQuit);
50 } else { 50 } else {
51 initialize().then(function() { 51 initialize().then(function() {
52 self.postMessage('received unexpected message'); 52 self.postMessage('received unexpected message');
53 self.postMessage('quit'); 53 self.postMessage('quit');
54 }); 54 });
55 } 55 }
56 } 56 };
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/chromium/resources/notificationclick-can-focus.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698