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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/misc/tests-finishing-simultaneously.html

Issue 2852753003: Gracefully handle tests finishing simultanously in 2+ secondary windows. (Closed)
Patch Set: Adding regression tests for https://crbug.com/716085#c10. Created 3 years, 8 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/http/tests/misc/tests-finishing-simultaneously.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/tests-finishing-simultaneously.html b/third_party/WebKit/LayoutTests/http/tests/misc/tests-finishing-simultaneously.html
new file mode 100644
index 0000000000000000000000000000000000000000..d08e60abddb3db99aaba4ad59b9f924528125bd1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/misc/tests-finishing-simultaneously.html
@@ -0,0 +1,47 @@
+<script>
+// This is a regresion test for a layout test harness crash that was
+// covered by https://crbug.com/716085#c10.
+
+// The test creates 2 subframes, each cross-origin from the main frame and from
+// each other. Once all the subframes report (via postMessage("subframe is
+// loaded"...)) that they are ready, the main frame asks them to nearly
+// simultaneously call testRunner.notifyDone() (from 2 separate OOPIF processes
+// under --site-per-process mode). This used to crash the layout tests harness.
+
+function addFrame(uri) {
+ var f = document.createElement('iframe');
+ f.src = uri;
+ document.body.appendChild(f);
+}
+
+var loaded_frames = 0;
+function onLoad() {
+ if (parent === self) {
+ document.body.innerText = 'Main frame';
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+
+ window.addEventListener("message", function(event) {
+ loaded_frames = loaded_frames + 1;
+ if (loaded_frames == 2) { // All subframes are ready?
+ for (var i = 0; i < window.frames.length; i++) {
+ window.frames[i].postMessage("notify done", "*");
+ }
+ }
+ }, false);
+
+ addFrame("https://localhost:8443/misc/tests-finishing-simultaneously.html");
+ addFrame("http://localhost:8000/misc/tests-finishing-simultaneously.html");
+ } else {
+ document.body.innerText = 'Subframe: ' + location.href;
+ window.addEventListener("message", function(event) {
+ testRunner.notifyDone();
+ }, false);
+ parent.postMessage("subframe is loaded", "*");
+ }
+}
+</script>
+<body onload="onLoad()">
+</body>
+

Powered by Google App Engine
This is Rietveld 408576698