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

Unified Diff: LayoutTests/fast/workers/worker-supplement-gc.html

Issue 178663004: Oilpan: move WorkerGlobalScope to oilpan's heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 9 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/workers/worker-supplement-gc-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/workers/worker-supplement-gc.html
diff --git a/LayoutTests/fast/workers/worker-supplement-gc.html b/LayoutTests/fast/workers/worker-supplement-gc.html
new file mode 100644
index 0000000000000000000000000000000000000000..ea5cebef70b8a437cfdccfd0c7d4339623bfdfd4
--- /dev/null
+++ b/LayoutTests/fast/workers/worker-supplement-gc.html
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML>
+<script src="../../resources/js-test.js"></script>
+<script src="resources/worker-create-common.js"></script>
+<script>
+description("Test GCing of WorkerGlobalScope supplementable");
+window.jsTestIsAsync = true;
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+function gc()
+{
+ if (window.GCController)
+ return GCController.collect();
+
+ for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
+ var s = new String("abc");
+ }
+}
+
+// Test that garbage collection of 'supplements' that extend the
+// WorkerGlobalScope object is well behaved.
+var worker = createWorker();
+var count = 0;
+
+function ping()
+{
+ worker.postMessage("eval gc(); self.performance && self.performance.now()");
+}
+worker.onmessage = function (e) {
+ if (count++ > 4)
+ finishJSTest();
+ else
+ ping();
+ gc();
+}
+ping();
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/workers/worker-supplement-gc-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698