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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/workers/semantics/multiple-workers/004.html

Issue 2418853003: Worker: Import "imported/wpt/workers" tests (Retry) (Closed)
Patch Set: rebase 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 <!doctype html>
2 <title>shared worker with multiple documents</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <div id=log></div>
6 <script>
7 var i = 0;
8 var load_count = 0;
9
10 var w1 = new SharedWorker('004-2.js', 'x');
11 w1.port.onmessage = function(e) {
12 i++;
13 check_result();
14 };
15
16
17 function iframe_loaded() {
18 load_count++;
19 check_result();
20 }
21
22 function check_result() {
23 //timeout to allow for extra, unexpected, messages to arrive
24 if (i == 3 && load_count == 2) {
25 setTimeout(function() {
26 assert_equals(load_count, 2);
27 assert_equals(i, 3);
28 done();
29 }, 500);
30 }
31 }
32 </script>
33 <iframe src=004-1.html onload="iframe_loaded()"></iframe>
34 <iframe src=004-1.html onload="iframe_loaded()"></iframe>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698