Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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() |
| OLD | NEW |