OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 | 9 |
10 class BlockOncePage(page_module.Page): | 10 class BlockOncePage(page_module.Page): |
(...skipping 18 matching lines...) Expand all Loading... |
29 window.post_request_completed = true; | 29 window.post_request_completed = true; |
30 var viaProxyRequest = new XMLHttpRequest(); | 30 var viaProxyRequest = new XMLHttpRequest(); |
31 viaProxyRequest.open("GET", | 31 viaProxyRequest.open("GET", |
32 "http://check.googlezip.net/image.png"); | 32 "http://check.googlezip.net/image.png"); |
33 viaProxyRequest.send(); | 33 viaProxyRequest.send(); |
34 }; | 34 }; |
35 request.send(); | 35 request.send(); |
36 })(); | 36 })(); |
37 ''') | 37 ''') |
38 action_runner.WaitForJavaScriptCondition( | 38 action_runner.WaitForJavaScriptCondition( |
39 "window.post_request_completed == true", 30) | 39 "window.post_request_completed == true", timeout_in_seconds=30) |
40 | 40 |
41 class BlockOnceStorySet(story.StorySet): | 41 class BlockOnceStorySet(story.StorySet): |
42 | 42 |
43 """ Chrome proxy test sites """ | 43 """ Chrome proxy test sites """ |
44 | 44 |
45 def __init__(self): | 45 def __init__(self): |
46 super(BlockOnceStorySet, self).__init__() | 46 super(BlockOnceStorySet, self).__init__() |
47 | 47 |
48 # Test block-once for a GET request. | 48 # Test block-once for a GET request. |
49 urls_list = [ | 49 urls_list = [ |
50 'http://check.googlezip.net/blocksingle/', | 50 'http://check.googlezip.net/blocksingle/', |
51 ] | 51 ] |
52 | 52 |
53 for url in urls_list: | 53 for url in urls_list: |
54 self.AddStory(BlockOncePage(url, self)) | 54 self.AddStory(BlockOncePage(url, self)) |
OLD | NEW |