Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import time | 6 import time |
| 7 | 7 |
| 8 import pyauto_functional | 8 import pyauto_functional |
| 9 import pyauto | 9 import pyauto |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 'No netflix credentials for %s.' % board_name | 41 'No netflix credentials for %s.' % board_name |
| 42 self._pyauto.NavigateToURL(credentials['login_url']) | 42 self._pyauto.NavigateToURL(credentials['login_url']) |
| 43 login_js = """ | 43 login_js = """ |
| 44 document.getElementById('email').value='%s'; | 44 document.getElementById('email').value='%s'; |
| 45 document.getElementById('password').value='%s'; | 45 document.getElementById('password').value='%s'; |
| 46 window.domAutomationController.send('ok'); | 46 window.domAutomationController.send('ok'); |
| 47 """ % (credentials[board_name], credentials['password']) | 47 """ % (credentials[board_name], credentials['password']) |
| 48 self._pyauto.assertEqual(self._pyauto.ExecuteJavascript(login_js), 'ok', | 48 self._pyauto.assertEqual(self._pyauto.ExecuteJavascript(login_js), 'ok', |
| 49 msg='Failed to set login credentials.') | 49 msg='Failed to set login credentials.') |
| 50 self._pyauto.assertTrue(self._pyauto.SubmitForm('login-form'), | 50 self._pyauto.assertTrue(self._pyauto.SubmitForm('login-form'), |
| 51 msg='Login to Netflix failed.') | 51 msg='Login to Netflix failed. We think this is an authetication ' |
| 52 'problem from Netflix side. Sometimes we also see this while login ' | |
|
krisr
2011/12/01 03:10:14
from the Netflix side.
while logging in manually.
| |
| 53 'manually.') | |
| 52 | 54 |
| 53 def _GetVideoDroppedFrames(self, tab_index=0, windex=0): | 55 def _GetVideoDroppedFrames(self, tab_index=0, windex=0): |
| 54 """Returns total Netflix video dropped frames.""" | 56 """Returns total Netflix video dropped frames.""" |
| 55 js = """ | 57 js = """ |
| 56 var frames = nrdp.video.droppedFrames; | 58 var frames = nrdp.video.droppedFrames; |
| 57 window.domAutomationController.send(frames + ''); | 59 window.domAutomationController.send(frames + ''); |
| 58 """ | 60 """ |
| 59 return int(self._pyauto.ExecuteJavascript(js, tab_index=tab_index, | 61 return int(self._pyauto.ExecuteJavascript(js, tab_index=tab_index, |
| 60 windex=windex)) | 62 windex=windex)) |
| 61 | 63 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 # crosbug.com/22037 | 160 # crosbug.com/22037 |
| 159 # In case player doesn't start playing at all, above while loop may | 161 # In case player doesn't start playing at all, above while loop may |
| 160 # still pass. So re-verifying and assuming that player did play something | 162 # still pass. So re-verifying and assuming that player did play something |
| 161 # during last 10 seconds. | 163 # during last 10 seconds. |
| 162 self.assertTrue(current_time > 0, | 164 self.assertTrue(current_time > 0, |
| 163 msg='Netflix player didnot start playing.') | 165 msg='Netflix player didnot start playing.') |
| 164 | 166 |
| 165 | 167 |
| 166 if __name__ == '__main__': | 168 if __name__ == '__main__': |
| 167 pyauto_functional.Main() | 169 pyauto_functional.Main() |
| OLD | NEW |