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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Window/Location/set-location-after-close.html
diff --git a/LayoutTests/fast/dom/Window/Location/set-location-after-close.html b/LayoutTests/fast/dom/Window/Location/set-location-after-close.html
index 5ec615c805899708fdc88ec7ca3f37110707c6d7..ee2e340cc7d600ded8cc760b00a382908500dea1 100644
--- a/LayoutTests/fast/dom/Window/Location/set-location-after-close.html
+++ b/LayoutTests/fast/dom/Window/Location/set-location-after-close.html
@@ -1,8 +1,13 @@
-<html>
-<body>
-This tests opens a new window, sets a timeout to close it, then sets a timeout to navigate it via window.location.
-We pass if we don't crash when setting the location of the already closed window.
+<!DOCTYPE HTML>
+<script src="../../../../resources/js-test.js"></script>
<script>
+description("Updating window.location after the window has been closed, without crashing.");
+
+// This tests opens a new window, sets a timeout to close it, then
+// sets a timeout to navigate it via window.location. We pass if we
+// don't crash when setting the location of the already closed window,
+// or when shutting down just after.
+
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setCanOpenWindows();
@@ -13,15 +18,22 @@ var w = window.open('resources/set-location-after-close-new-window.html');
window.addEventListener("message", processMessage, false);
+function finish() {
+ // Clear out window and force a GC to finalize the Window
+ // object and its wrapper. Verifies that the shutdown is
+ // done in an orderly manner.
+ w = null;
+ gc();
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
function processMessage(event) {
if (event.data == "opened")
w.close();
else if (event.data == "closed") {
w.location = '';
- if (window.testRunner)
- testRunner.notifyDone();
+ setInterval(finish, 0);
}
}
</script>
-</body>
-</html>
« 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