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

Unified Diff: chrome/test/data/magic_iframe/iframe-reparenting-close-window-iframe.html

Issue 7550021: Add a browsertest for magic iframe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actually disable the test Created 9 years, 5 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: chrome/test/data/magic_iframe/iframe-reparenting-close-window-iframe.html
diff --git a/chrome/test/data/magic_iframe/iframe-reparenting-close-window-iframe.html b/chrome/test/data/magic_iframe/iframe-reparenting-close-window-iframe.html
new file mode 100755
index 0000000000000000000000000000000000000000..90f6f3dc5287c54ed72560044e43bf498e5906c3
--- /dev/null
+++ b/chrome/test/data/magic_iframe/iframe-reparenting-close-window-iframe.html
@@ -0,0 +1,39 @@
+<html>
+<head>
+<script>
+var logWin = window.parent.opener;
+logWin.log('Iframe is being loaded.');
+
+var xhr = new XMLHttpRequest();
+xhr.onreadystatechange = function() {
+ logWin.log('xhr onreadystatechange state:' + xhr.readyState);
+ if (xhr.readyState == 4) {
+ var text = xhr.responseText;
+ // Report that the test is finished.
+ logWin.finish();
+ }
+}
+
+xhr.onerror = function() {
+ logWin.log('xhr onerror:' + xhr.readyState);
+}
+
+// Timeout explanation:
+// To reproduce the issue, I need the XHR to start but not finish until the
+// iframe transfer is complete. If I just navigate to some file, the load
+// actually happens before the iframe is transferred and all the onreadystatechange
+// notifications are already queued and just fire in the new page.
+// The bug, however, deals with XHR being still in progress in the browser process,
+// so when it is done and comes back with the routing_id of the closed window,
+// it has no way of finding the original iframe and firing onreadystatechange.
+// Having this timeout theoretically can make the test occasionally produce false
+// positive (if the reparenting takes longer then 1 second for example) however this
+// is very unlikely, and it won't make test flakey (false negative).
+xhr.open('GET', '/slow?1', true);
+xhr.send();
+window.parent.transferIframeAndCloseWindow();
+</script>
+</head>
+<body>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698