OLD | NEW |
---|---|
(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:])) | |
OLD | NEW |