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

Unified Diff: third_party/WebKit/LayoutTests/fast/harness/internals-observe-gc.html

Issue 1950613005: Fixes tests that use internals.observeGC to work with Ignition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes comments and fixes more tests. Created 4 years, 7 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
Index: third_party/WebKit/LayoutTests/fast/harness/internals-observe-gc.html
diff --git a/third_party/WebKit/LayoutTests/fast/harness/internals-observe-gc.html b/third_party/WebKit/LayoutTests/fast/harness/internals-observe-gc.html
index 803497787766eaceb30d56b2883a973bc053b152..768566cc1b3c524e06a24ae894b9f9ac04e5da9c 100644
--- a/third_party/WebKit/LayoutTests/fast/harness/internals-observe-gc.html
+++ b/third_party/WebKit/LayoutTests/fast/harness/internals-observe-gc.html
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
+<script src="../../resources/observeGC.js"></script>
<body>
<script>
description('Tests that the window.internals.observeGC hook works.');
@@ -10,7 +11,7 @@ shouldBe('typeof window.internals.observeGC', '"function"',
// "Generic Kid's Movie III": ... where nobody dies.
var valueA = {};
-observationA = internals.observeGC(valueA);
+observationA = observeGC(() => {return valueA;});
gc();
shouldBeFalse('observationA.wasCollected');
// value ineligible for GC should not be flagged as collected
@@ -20,7 +21,7 @@ observationA = null;
// "Romeo and GCuliet": Romeo JavaScript finds G.uliet C.apulet and dies.
var valueB = {};
-observationB = internals.observeGC(valueB);
+observationB = observeGC(() => {return valueB;});
valueB = null;
gc();
shouldBeTrue('observationB.wasCollected');
@@ -31,7 +32,7 @@ observationB = null;
// innocence. And a DOM node.
var valueC = document.createElement('div');
-observationC = internals.observeGC(valueC);
+observationC = observeGC(() => {return valueC;});
valueC = null;
gc();
shouldBeTrue('observationC.wasCollected');
@@ -40,13 +41,15 @@ observationC = null;
// Now, movies that failed:
-shouldThrow('internals.observeGC(undefined)', '"TypeError: value to observe is null or undefined"');
-shouldThrow('internals.observeGC(null)', '"TypeError: value to observe is null or undefined"');
+shouldThrow('observeGC(() => {return undefined;})',
+ '"TypeError: value to observe is null or undefined"');
+shouldThrow('observeGC(() => {return null;})',
+ '"TypeError: value to observe is null or undefined"');
// Try to create objects and observers that will die at once
var valueD = {};
-var observerD = internals.observeGC(valueD);
+var observerD = observeGC(() => {return valueD;});
valueD.observer = observerD;
observerD.observed = valueD;
valueD = observerD = null;

Powered by Google App Engine
This is Rietveld 408576698