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

Side by Side Diff: tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/pass_through.py

Issue 2719853003: [Telemetry refactor] Drop "2" from method calls to JS API (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from common.chrome_proxy_shared_page_state import ChromeProxySharedPageState 5 from common.chrome_proxy_shared_page_state import ChromeProxySharedPageState
6 from telemetry.page import page as page_module 6 from telemetry.page import page as page_module
7 from telemetry import story 7 from telemetry import story
8 8
9 class PassThroughPage(page_module.Page): 9 class PassThroughPage(page_module.Page):
10 """ 10 """
11 A test page for the chrome proxy pass-through tests. 11 A test page for the chrome proxy pass-through tests.
12 """ 12 """
13 13
14 def __init__(self, url, page_set): 14 def __init__(self, url, page_set):
15 super(PassThroughPage, self).__init__(url=url, page_set=page_set, 15 super(PassThroughPage, self).__init__(url=url, page_set=page_set,
16 shared_page_state_class=ChromeProxySharedPageState) 16 shared_page_state_class=ChromeProxySharedPageState)
17 17
18 def RunNavigateSteps(self, action_runner): 18 def RunNavigateSteps(self, action_runner):
19 super(PassThroughPage, self).RunNavigateSteps(action_runner) 19 super(PassThroughPage, self).RunNavigateSteps(action_runner)
20 action_runner.ExecuteJavaScript2(''' 20 action_runner.ExecuteJavaScript('''
21 (function() { 21 (function() {
22 var request = new XMLHttpRequest(); 22 var request = new XMLHttpRequest();
23 request.open("GET", {{ url }}); 23 request.open("GET", {{ url }});
24 request.setRequestHeader("Chrome-Proxy-Accept-Transform", "identity"); 24 request.setRequestHeader("Chrome-Proxy-Accept-Transform", "identity");
25 request.send(null); 25 request.send(null);
26 })();''', url=self.url) 26 })();''', url=self.url)
27 action_runner.Wait(1) 27 action_runner.Wait(1)
28 28
29 29
30 class PassThroughStorySet(story.StorySet): 30 class PassThroughStorySet(story.StorySet):
31 """ Chrome proxy test sites """ 31 """ Chrome proxy test sites """
32 32
33 def __init__(self): 33 def __init__(self):
34 super(PassThroughStorySet, self).__init__() 34 super(PassThroughStorySet, self).__init__()
35 35
36 urls_list = [ 36 urls_list = [
37 'http://check.googlezip.net/image.png', 37 'http://check.googlezip.net/image.png',
38 ] 38 ]
39 39
40 for url in urls_list: 40 for url in urls_list:
41 self.AddStory(PassThroughPage(url, self)) 41 self.AddStory(PassThroughPage(url, self))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698