summaryrefslogtreecommitdiffstats
path: root/tools/telemetry
diff options
context:
space:
mode:
Diffstat (limited to 'tools/telemetry')
-rw-r--r--tools/telemetry/telemetry/page/actions/js_collect_garbage.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/telemetry/telemetry/page/actions/js_collect_garbage.py b/tools/telemetry/telemetry/page/actions/js_collect_garbage.py
new file mode 100644
index 0000000..0acfc2c
--- /dev/null
+++ b/tools/telemetry/telemetry/page/actions/js_collect_garbage.py
@@ -0,0 +1,14 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+from telemetry.page.actions import page_action
+
+class JsCollectGarbageAction(page_action.PageAction):
+ def __init__(self, attributes=None):
+ super(JsCollectGarbageAction, self).__init__(attributes)
+
+ def CustomizeBrowserOptions(self, options):
+ options.AppendExtraBrowserArg('--js-flags=--expose-gc')
+
+ def RunAction(self, page, tab, previous_action):
+ tab.EvaluateJavaScript('window.gc(); window.gc();')