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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/wpt/workers/semantics/multiple-workers/004.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/workers/semantics/multiple-workers/004.html b/third_party/WebKit/LayoutTests/imported/wpt/workers/semantics/multiple-workers/004.html
new file mode 100644
index 0000000000000000000000000000000000000000..c4733700865be70f27d35312bdbb2de9b9cc4410
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/workers/semantics/multiple-workers/004.html
@@ -0,0 +1,34 @@
+<!doctype html>
+<title>shared worker with multiple documents</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+var i = 0;
+var load_count = 0;
+
+var w1 = new SharedWorker('004-2.js', 'x');
+w1.port.onmessage = function(e) {
+ i++;
+ check_result();
+};
+
+
+function iframe_loaded() {
+ load_count++;
+ check_result();
+}
+
+function check_result() {
+ //timeout to allow for extra, unexpected, messages to arrive
+ if (i == 3 && load_count == 2) {
+ setTimeout(function() {
+ assert_equals(load_count, 2);
+ assert_equals(i, 3);
+ done();
+ }, 500);
+ }
+}
+</script>
+<iframe src=004-1.html onload="iframe_loaded()"></iframe>
+<iframe src=004-1.html onload="iframe_loaded()"></iframe>

Powered by Google App Engine
This is Rietveld 408576698