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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/workers/constructors/SharedWorker/same-origin.html

Issue 2420483004: Revert of Worker: Import "imported/wpt/workers" tests (Closed)
Patch Set: Fix merge error Created 4 years, 2 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 <!--
2 /*
3 -->
4 <!doctype html>
5 <title>same-origin checks</title>
6 <link rel=help href="http://www.whatwg.org/html/#dom-sharedworker">
7 <script src="/resources/testharness.js"></script>
8 <script src="/resources/testharnessreport.js"></script>
9 <div id="log"></div>
10 <script>
11 // Needed to prevent a race condition if a worker throws an exception that may o r may
12 // not propogate to the window before the tests finish
13 setup({allow_uncaught_exception: true});
14
15 function testSharedWorkerHelper(t, script) {
16 try {
17 var worker = new SharedWorker(script, '');
18 worker.onerror = t.step_func_done(function(e) {
19 assert_true(e instanceof ErrorEvent);
20 });
21 } catch (e) {
22 t.step_func_done(function(e) { assert_true(true); });
23 }
24 }
25
26 test(function() {
27 assert_throws("SecurityError", function() { new SharedWorker('unsupported:', ' '); });
28 }, "unsupported_scheme");
29
30 async_test(function() {
31 var worker = new SharedWorker('data:,onconnect = function(e) { e.ports[0].post Message(1); }', '');
32 worker.port.onmessage = this.step_func_done(function(e) {
33 assert_equals(e.data, 1);
34 });
35 }, "data_url");
36
37 async_test(function(t) {
38 testSharedWorkerHelper(this, 'javascript:""');
39 }, "javascript_url");
40
41 async_test(function(t) {
42 testSharedWorkerHelper(this, 'about:blank');
43 }, "about_blank");
44
45 async_test(function(t) {
46 testSharedWorkerHelper(this, 'http://www.opera.com/');
47 }, "opera_com");
48
49 async_test(function(t) {
50 testSharedWorkerHelper(this, location.protocol+'//'+location.hostname+':81/');
51 }, "port_81");
52
53 async_test(function(t) {
54 testSharedWorkerHelper(this, 'https://'+location.hostname+':80/');
55 }, "https_port_80");
56
57 async_test(function(t) {
58 testSharedWorkerHelper(this, 'https://'+location.hostname+':8000/');
59 }, "https_port_8000");
60
61 async_test(function(t) {
62 testSharedWorkerHelper(this, 'http://'+location.hostname+':8012/');
63 }, "http_port_8012");
64 </script>
65 <!--
66 */
67 //-->
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698