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

Unified Diff: tools/telemetry/examples/telemetry_extension_test.py

Issue 11412238: Proof of concept for running extension API stack through dev tools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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 | « chrome/test/telemetry_auto/OWNERS ('k') | tools/telemetry/telemetry/android_browser_backend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/examples/telemetry_extension_test.py
diff --git a/tools/telemetry/examples/telemetry_extension_test.py b/tools/telemetry/examples/telemetry_extension_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..27afa906c0f02449b58f35166bc9c201b5cebd19
--- /dev/null
+++ b/tools/telemetry/examples/telemetry_extension_test.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 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.
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+
+import telemetry
+from telemetry import extension_page
+
+def Main(args):
+ options = telemetry.BrowserOptions()
+ parser = options.CreateParser('telemetry_extension_test.py')
+ options, args = parser.parse_args(args)
+
+ browser_to_create = telemetry.FindBrowser(options)
+ assert browser_to_create
+ with browser_to_create.Create() as b:
+ ext = b.extensions.FindByUrl(
+ 'chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/' +
+ '_generated_background_page.html')
+ create_properties = { 'url':'http://www.google.com' }
+ arguments = ext.RunMethod("chrome.tabs.create",
+ create_properties)
+ print arguments
+
+ create_properties = { 'url':'http://www.cnn.com' }
+ results = ext.RunMethodWithEvents(
+ [extension_page.ExtensionEvent('chrome.tabs.onCreated'),
+ extension_page.ExtensionEvent('chrome.tabs.onHighlighted')],
+ 'chrome.tabs.create',
+ create_properties)
+
+ print results
+
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(Main(sys.argv[1:]))
« no previous file with comments | « chrome/test/telemetry_auto/OWNERS ('k') | tools/telemetry/telemetry/android_browser_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698