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

Unified Diff: third_party/WebKit/LayoutTests/bindings/location-lifetime.html

Issue 2826393004: v8binding: Makes Location's wrapper objects alive, really. (Closed)
Patch Set: Added a layout test. Created 3 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 | third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/bindings/location-lifetime.html
diff --git a/third_party/WebKit/LayoutTests/bindings/location-lifetime.html b/third_party/WebKit/LayoutTests/bindings/location-lifetime.html
new file mode 100644
index 0000000000000000000000000000000000000000..2fa7c79b8e0c4a24129ff55c91dcb87748406e30
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/bindings/location-lifetime.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<iframe id="iframe-for-document.location"></iframe>
+<iframe id="iframe-for-window.location"></iframe>
+<script>
+test(() => {
+ let observation;
+ (function() {
+ let iframe = document.getElementById("iframe-for-document.location");
+ let location = iframe.contentDocument.location;
+ observation = internals.observeGC(location);
+ })();
+ gc();
+ assert_false(observation.wasCollected, "Location wrapper object was collected.");
+}, "document.location shouldn't be collected by GC.");
+
+test(() => {
+ let observation;
+ (function() {
+ let iframe = document.getElementById("iframe-for-window.location");
+ let location = iframe.contentWindow.location;
+ observation = internals.observeGC(location);
+ })();
+ gc();
+ assert_false(observation.wasCollected, "Location wrapper object was collected.");
+}, "window.location shouldn't be collected by GC.");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698