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

Unified Diff: LayoutTests/media/video-test.js

Issue 180203002: Add EME content test that forces garbage collection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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: LayoutTests/media/video-test.js
diff --git a/LayoutTests/media/video-test.js b/LayoutTests/media/video-test.js
index e558c1db9a90094ddbfc71a27856c090e750edfb..a0e29d696b620b39832708703927307a7829c97b 100644
--- a/LayoutTests/media/video-test.js
+++ b/LayoutTests/media/video-test.js
@@ -364,3 +364,18 @@ function waitForEventsAndCall(eventList, func)
eventList[i][0].addEventListener(requiredEvents[i], _eventCallback, true);
}
}
+
+function forceGC()
+{
+ // Available in content_tests
+ if (window.GCController)
+ return GCController.collect();
+
+ // Available if '--js-flags="--expose_gc"' specified
+ if (typeof gc == 'function')
+ return gc();
+
+ // Force garbage collection
+ for (var ndx = 0; ndx < 99000; ndx++)
+ var str = new String("1234");
+}

Powered by Google App Engine
This is Rietveld 408576698