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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/clients-openwindow.html

Issue 1506783003: ServiceWorker: Reject TypeError instead of SecurityError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/clients-openwindow.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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Service Worker: clients.openWindow() tests (using testRunner)</title> 2 <title>Service Worker: clients.openWindow() tests (using testRunner)</title>
3 <script src="../../resources/testharness.js"></script> 3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script> 4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="../resources/test-helpers.js"></script> 5 <script src="../resources/test-helpers.js"></script>
6 <script> 6 <script>
7 // This test is using testRunner to grant itself the notification permission and 7 // This test is using testRunner to grant itself the notification permission and
8 // to simulate a click on a notification. A couple of changes would allow it to 8 // to simulate a click on a notification. A couple of changes would allow it to
9 // be run as a manual test by other browser vendors. 9 // be run as a manual test by other browser vendors.
10 if (window.testRunner) 10 if (window.testRunner)
(...skipping 28 matching lines...) Expand all
39 ' visibilityState: visible', 39 ' visibilityState: visible',
40 ' focused: true', 40 ' focused: true',
41 ' frameType: top-level', 41 ' frameType: top-level',
42 'openWindow() can open about:blank', 42 'openWindow() can open about:blank',
43 'openWindow() result: null', 43 'openWindow() result: null',
44 'openWindow() can open about:crash', 44 'openWindow() can open about:crash',
45 'openWindow() result: null', 45 'openWindow() result: null',
46 'openWindow() can not open an invalid url', 46 'openWindow() can not open an invalid url',
47 'openWindow() error is: TypeError', 47 'openWindow() error is: TypeError',
48 'openWindow() can not open view-source scheme', 48 'openWindow() can not open view-source scheme',
49 'openWindow() error is: TypeError',
49 'openWindow() can not open file scheme', 50 'openWindow() can not open file scheme',
50 'openWindow() error is: SecurityError', 51 'openWindow() error is: TypeError',
51 ]; 52 ];
52 53
53 // LayoutTests on Mac do not open focused windows. 54 // LayoutTests on Mac do not open focused windows.
54 var isMac = navigator.platform.indexOf('Mac') == 0; 55 var isMac = navigator.platform.indexOf('Mac') == 0;
55 if (isMac) 56 if (isMac)
56 expected[10] = ' focused: false'; 57 expected[10] = ' focused: false';
57 58
58 function onMessage(e) { 59 function onMessage(e) {
59 var message = e.data; 60 var message = e.data;
60 61
61 if (typeof(message) === 'object') { 62 if (typeof(message) === 'object') {
62 if (message.type !== 'click') 63 if (message.type !== 'click')
63 return; 64 return;
64 if (window.testRunner) 65 if (window.testRunner)
65 testRunner.simulateWebNotificationClick(message.title); 66 testRunner.simulateWebNotificationClick(message.title);
66 return; 67 return;
67 } 68 }
68 69
69 if (message === 'quit') { 70 if (message === 'quit') {
70 assert_array_equals(result, expected, 71 assert_array_equals(result, expected,
71 'Worker should post back expected messages.'); 72 'Worker should post back expected messages.');
72 service_worker_unregister_and_done(t, scope); 73 service_worker_unregister_and_done(t, scope);
73 } else { 74 } else {
74 result.push(message); 75 result.push(message);
75 } 76 }
76 } 77 }
77 }); 78 });
78 </script> 79 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/clients-openwindow.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698