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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/history/history-back-twice-with-subframes-assert.html

Issue 2295653002: Use window.testRunner in if-clause (Closed)
Patch Set: a Created 4 years, 3 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script> 2 <script>
3 if (testRunner) { 3 if (window.testRunner) {
4 testRunner.dumpAsText(); 4 testRunner.dumpAsText();
5 testRunner.waitUntilDone(); 5 testRunner.waitUntilDone();
6 } 6 }
7 7
8 function runTest() { 8 function runTest() {
9 var loadCount = 2; 9 var loadCount = 2;
10 var didGoBack = false; 10 var didGoBack = false;
11 11
12 var frame1 = document.getElementById('frame1'); 12 var frame1 = document.getElementById('frame1');
13 var frame2 = document.getElementById('frame2'); 13 var frame2 = document.getElementById('frame2');
14 frame1.onload = frame2.onload = function() { 14 frame1.onload = frame2.onload = function() {
15 loadCount--; 15 loadCount--;
16 if (loadCount) 16 if (loadCount)
17 return; 17 return;
18 18
19 if (!didGoBack) { 19 if (!didGoBack) {
20 // We've navigated both frames, now go back 2 steps. 20 // We've navigated both frames, now go back 2 steps.
21 loadCount = 2; 21 loadCount = 2;
22 history.go(-2); 22 history.go(-2);
23 didGoBack = true; 23 didGoBack = true;
24 return; 24 return;
25 } 25 }
26 26
27 if (testRunner) 27 if (window.testRunner)
28 testRunner.notifyDone(); 28 testRunner.notifyDone();
29 } 29 }
30 30
31 frame1.src = frame2.src = 'data:text/html,navigated'; 31 frame1.src = frame2.src = 'data:text/html,navigated';
32 } 32 }
33 </script> 33 </script>
34 <body onload="setTimeout(runTest, 0)"> 34 <body onload="setTimeout(runTest, 0)">
35 <div>This tests that navigating two subframes and then going back using history. go(-2) won't assert.</div> 35 <div>This tests that navigating two subframes and then going back using history. go(-2) won't assert.</div>
36 <iframe id='frame1' src='data:text/html,frame1'></iframe> 36 <iframe id='frame1' src='data:text/html,frame1'></iframe>
37 <iframe id='frame2' src='data:text/html,frame2'></iframe> 37 <iframe id='frame2' src='data:text/html,frame2'></iframe>
38 </body> 38 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698