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

Side by Side 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: now moved method outside of the class Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/magic_iframe/iframe-reparenting-close-window-child.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script>
4 var logWin = window.parent.opener;
5 logWin.log('Iframe is being loaded.');
6
7 var xhr = new XMLHttpRequest();
8 xhr.onreadystatechange = function() {
9 logWin.log('xhr onreadystatechange state:' + xhr.readyState);
10 if (xhr.readyState == 4) {
11 var text = xhr.responseText;
12 // Report that the test is finished.
13 logWin.finish();
14 }
15 }
16
17 xhr.onerror = function() {
18 logWin.log('xhr onerror:' + xhr.readyState);
19 }
20
21 // Timeout explanation:
22 // To reproduce the issue, I need the XHR to start but not finish until the
23 // iframe transfer is complete. If I just navigate to some file, the load
24 // actually happens before the iframe is transferred and all the
25 // onreadystatechange notifications are already queued and just fire in the new
26 // page.
27 // The bug, however, deals with XHR being still in progress in the browser
28 // process, so when it is done and comes back with the routing_id of the closed
29 // window, it has no way of finding the original iframe and firing
30 // onreadystatechange. Because of this timeout the test can occasionally produce
31 // false positive (if the reparenting takes longer then 1 second for example),
32 // however this is very unlikely, and it won't make test flakey
33 // (which is usually a false negative).
34 xhr.open('GET', '/slow?1', true);
35 xhr.send();
36 window.parent.transferIframeAndCloseWindow();
37 </script>
38 </head>
39 <body>
40 </body>
41 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/magic_iframe/iframe-reparenting-close-window-child.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698