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

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
8 sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
9
10 import telemetry
11
12 def Main(args):
13 options = telemetry.BrowserOptions()
14 parser = options.CreateParser('telemetry_extension_test.py')
nduca 2012/12/07 19:23:47 should there be an extension as part of this? just
zel 2012/12/12 21:03:42 will ping you about this in person
15 options, args = parser.parse_args(args)
16
17 browser_to_create = telemetry.FindBrowser(options)
18 assert browser_to_create
19 with browser_to_create.Create() as b:
20 with b.ConnectToExtensionPage("aapnijgdinlhnhlmodcfapnahmbfebeb") as ext:
21 create_properties = { 'url':'http://www.google.com' }
22 arguments = ext.RunMethod("chrome.tabs.create",
23 create_properties)
24 print arguments
25
26 create_properties = { 'url':'http://www.cnn.com' }
27 results = ext.RunMethodWithEvents(
28 ['chrome.tabs.onCreated', 'chrome.tabs.onHighlighted'],
29 'chrome.tabs.create',
30 create_properties)
31 print results
32
33 return 0
34
35 if __name__ == '__main__':
36 sys.exit(Main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698