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

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: Created 8 years, 1 month 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: 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 100644
index 0000000000000000000000000000000000000000..73ba7b16dbffd4a3758d83bb862968a8ec5f6dcb
--- /dev/null
+++ b/tools/telemetry/examples/telemetry_extension_test.py
@@ -0,0 +1,28 @@
+#!/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
+import time
+
+sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
nduca 2012/11/29 05:09:27 you can even move this file to the telemetry_auto
+
+import telemetry
+
+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)
nduca 2012/11/29 05:09:27 seems like we should add a feature on BrowserOptio
zel 2012/11/29 22:58:45 Sure, will sync up with you about this one.
+ assert browser_to_create
+ with browser_to_create.Create() as b:
+ with b.ConnectToExtensionPage('aapnijgdinlhnhlmodcfapnahmbfebeb') as ext:
+ ext.runtime.Evaluate("chrome.tabs.create({url:'http://www.google.com'},function(){})")
nduca 2012/11/29 05:09:27 so to do this synchronously you'd do this: ext.ru
zel 2012/11/29 22:58:45 Done. I've created a new class ExtensionPage that
+ print "DONE!"
+
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(Main(sys.argv[1:]))

Powered by Google App Engine
This is Rietveld 408576698