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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/workers/constructors/SharedWorker/URLMismatchError.htm

Issue 2446483002: Import wpt@c5a14f553cba5f197743b9af605a84eddd8692a2 (Closed)
Patch Set: 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <meta charset="utf-8"> 2 <meta charset="utf-8">
3 <title>Web Workers: SharedWorker - throw URLMismatchError</title> 3 <title>Web Workers: SharedWorker - same name, different URL</title>
4 <link rel="author" title="Intel" href="http://www.intel.com"> 4 <link rel="author" title="Intel" href="http://www.intel.com">
5 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script> 6 <script src="/resources/testharnessreport.js"></script>
7 <div id="log"></div> 7 <div id="log"></div>
8 <script> 8 <script>
9 var counter = 0
10 function maybeDone() {
11 if(counter) {
12 done()
13 }
14 counter++
15 }
9 16
10 test(function() { 17 var worker = new SharedWorker('shared-worker.js', 'name');
11 var worker = new SharedWorker('shared-worker.js', 'name'); 18 worker.port.postMessage("trigger a response")
19 worker.port.onmessage = (e) => {
20 assert_equals(e.data, "ping")
21 maybeDone()
22 }
12 23
13 assert_throws("URLMismatchError", function() { 24 // This used to throw "URLMismatchError", but the standard changed
14 new SharedWorker('some-other-url.js', 'name'); 25 var worker2 = new SharedWorker('1', 'name');
15 }); 26 worker2.port.onmessage = (e) => {
16 27 assert_array_equals(e.data, ["1", "name"])
17 }, "Create SharedWorker with different URLs but same name"); 28 maybeDone()
18 29 }
19 </script> 30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698