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

Side by Side Diff: tools/chrome_proxy/webdriver/video.py

Issue 2704423002: Add Youtube auto play integration test (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2017 The Chromium Authors. All rights reserved. 1 # Copyright 2017 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 import time 5 import time
6 6
7 import common 7 import common
8 from common import TestDriver 8 from common import TestDriver
9 from common import IntegrationTest 9 from common import IntegrationTest
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 self.fail('Could not get a compressed video after %d tries' % attempts) 110 self.fail('Could not get a compressed video after %d tries' % attempts)
111 t.ExecuteJavascriptStatement('test.ready = true') 111 t.ExecuteJavascriptStatement('test.ready = true')
112 wait_time = int(t.ExecuteJavascriptStatement('test.waitTime')) 112 wait_time = int(t.ExecuteJavascriptStatement('test.waitTime'))
113 t.WaitForJavascriptExpression('test.metrics.complete', wait_time) 113 t.WaitForJavascriptExpression('test.metrics.complete', wait_time)
114 metrics = t.ExecuteJavascriptStatement('test.metrics') 114 metrics = t.ExecuteJavascriptStatement('test.metrics')
115 if not metrics['complete']: 115 if not metrics['complete']:
116 raise Exception('Test not complete after %d seconds.' % wait_time) 116 raise Exception('Test not complete after %d seconds.' % wait_time)
117 if metrics['failed']: 117 if metrics['failed']:
118 raise Exception('Test failed!') 118 raise Exception('Test failed!')
119 119
120 # Make sure YouTube autoplays.
121 def testYoutube(self):
RyanSturm 2017/02/21 18:37:48 Desktop only?
122 with TestDriver() as t:
123 t.AddChromeArg('--enable-spdy-proxy-auth')
124 t.LoadURL('http://data-saver-test.appspot.com/youtube')
125 t.WaitForJavascriptExpression(
126 'window.playerState == YT.PlayerState.PLAYING', 30)
127 for response in t.GetHTTPResponses():
128 if not response.url.startswith('https'):
129 self.assertHasChromeProxyViaHeader(response)
130
120 if __name__ == '__main__': 131 if __name__ == '__main__':
121 IntegrationTest.RunAllTests() 132 IntegrationTest.RunAllTests()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698