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

Side by Side Diff: LayoutTests/fast/dom/Window/Location/set-location-after-close.html

Issue 258843002: Remove unsound asserts in the DOMWindow destructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Invert and use ASSERT_ENABLED Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/Location/set-location-after-close-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <!DOCTYPE HTML>
2 <body> 2 <script src="../../../../resources/js-test.js"></script>
3 This tests opens a new window, sets a timeout to close it, then sets a timeout t o navigate it via window.location.
4 We pass if we don't crash when setting the location of the already closed window .
5 <script> 3 <script>
4 description("Updating window.location after the window has been closed, without crashing.");
5
6 // This tests opens a new window, sets a timeout to close it, then
7 // sets a timeout to navigate it via window.location. We pass if we
8 // don't crash when setting the location of the already closed window,
9 // or when shutting down just after.
10
6 if (window.testRunner) { 11 if (window.testRunner) {
7 testRunner.dumpAsText(); 12 testRunner.dumpAsText();
8 testRunner.setCanOpenWindows(); 13 testRunner.setCanOpenWindows();
9 testRunner.waitUntilDone(); 14 testRunner.waitUntilDone();
10 } 15 }
11 16
12 var w = window.open('resources/set-location-after-close-new-window.html'); 17 var w = window.open('resources/set-location-after-close-new-window.html');
13 18
14 window.addEventListener("message", processMessage, false); 19 window.addEventListener("message", processMessage, false);
15 20
21 function finish() {
22 // Clear out window and force a GC to finalize the Window
23 // object and its wrapper. Verifies that the shutdown is
24 // done in an orderly manner.
25 w = null;
26 gc();
27 if (window.testRunner)
28 testRunner.notifyDone();
29 }
30
16 function processMessage(event) { 31 function processMessage(event) {
17 if (event.data == "opened") 32 if (event.data == "opened")
18 w.close(); 33 w.close();
19 else if (event.data == "closed") { 34 else if (event.data == "closed") {
20 w.location = ''; 35 w.location = '';
21 if (window.testRunner) 36 setInterval(finish, 0);
22 testRunner.notifyDone();
23 } 37 }
24 } 38 }
25 </script> 39 </script>
26 </body>
27 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/Location/set-location-after-close-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698