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

Side by Side 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 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5 import os
6 import sys
7 import time
8
9 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
10
11 import telemetry
12
13 def Main(args):
14 options = telemetry.BrowserOptions()
15 parser = options.CreateParser('telemetry_extension_test.py')
16 options, args = parser.parse_args(args)
17
18 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.
19 assert browser_to_create
20 with browser_to_create.Create() as b:
21 with b.ConnectToExtensionPage('aapnijgdinlhnhlmodcfapnahmbfebeb') as ext:
22 ext.runtime.Evaluate("chrome.tabs.create({url:'http://www.google.com'},fun ction(){})")
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
23 print "DONE!"
24
25 return 0
26
27 if __name__ == '__main__':
28 sys.exit(Main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698