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

Side by Side Diff: LayoutTests/http/tests/notifications/resources/serviceworker-click-can-focus.js

Issue 896043004: Tests for WaitUntilObserver and focus/openining windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sw_client_focus_cleanup
Patch Set: 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
OLDNEW
(Empty)
1 importScripts('../../serviceworker/resources/worker-testharness.js');
2 importScripts('/resources/testharness-helpers.js');
3
4 // var focusSucceeded = false;
5
6 // function saveFocusResult(r) {
7 // focusSucceeded = r instanceof WindowClient;
8 // }
9
10 // function fucusSucceeded() {
11 // return focusSucceeded;
12 // }
13
14 async_test(function(test) {
15 var notification = new Notification('Notification 1');
16
17 notification.addEventListener('show', function() {
18 testRunner.simulateWebNotificationClick('Notification 1');
19 });
20
21 notification.addEventListener('click', function() {
22 test.done();
23 clients.getAll().then(function(clients) {
24 return assert_promise_rejects(clients[0].focus());
25 }).then(function() {
26 test.done();
27 });
28 });
29 }, '');
30
31 // async_test(function(test) {
32 // var notification = new Notification('Notification 2');
33 // notification.addEventListener('show', function() {
34 // if (testRunner)
35 // testRunner.simulateWebNotificationClick('Notification 2');
36 // });
37
38 // notification.addEventListener('click', function(e) {
39 // e.waitUntil(clients.getAll().then(function(clients) {
40 // return clients[0].focus().then(function() {
41 // test.done();
42 // });
43 // }));
44 // });
45 // }, 'The notificationclick and notificationerror events exist on the global sc ope.');
46
47 // async_test(function(test) {
48 // var notification = new Notification('Notification 2');
49 // notification.addEventListener('show', function() {
50 // if (testRunner)
51 // testRunner.simulateWebNotificationClick('Notification 2');
52 // });
53
54 // notification.addEventListener('click', function(e) {
55 // e.waitUntil(clients.getAll().then(function(clients) {
56 // return clients[0].focus().then(function() {
57 // return clients[0].focus();
58 // }).catch(function() {
59 // test.done();
60 // });
61 // }));
62 // });
63 // }, 'The notificationclick and notificationerror events exist on the global sc ope.');
64
65 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698