| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 from chrome_remote_control import inspector_console | 4 from chrome_remote_control import inspector_console |
| 5 from chrome_remote_control import inspector_page | 5 from chrome_remote_control import inspector_page |
| 6 from chrome_remote_control import inspector_runtime | 6 from chrome_remote_control import inspector_runtime |
| 7 from chrome_remote_control import util | 7 from chrome_remote_control import util |
| 8 | 8 |
| 9 DEFAULT_TAB_TIMEOUT = 60 | 9 DEFAULT_TAB_TIMEOUT = 60 |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 util.WaitFor( | 68 util.WaitFor( |
| 69 lambda: self._runtime.Evaluate('document.readyState') == 'complete', | 69 lambda: self._runtime.Evaluate('document.readyState') == 'complete', |
| 70 timeout) | 70 timeout) |
| 71 | 71 |
| 72 def WaitForDocumentReadyStateToBeInteractiveOrBetter( | 72 def WaitForDocumentReadyStateToBeInteractiveOrBetter( |
| 73 self, timeout=DEFAULT_TAB_TIMEOUT): | 73 self, timeout=DEFAULT_TAB_TIMEOUT): |
| 74 def IsReadyStateInteractiveOrBetter(): | 74 def IsReadyStateInteractiveOrBetter(): |
| 75 rs = self._runtime.Evaluate('document.readyState') | 75 rs = self._runtime.Evaluate('document.readyState') |
| 76 return rs == 'complete' or rs == 'interactive' | 76 return rs == 'complete' or rs == 'interactive' |
| 77 util.WaitFor(IsReadyStateInteractiveOrBetter, timeout) | 77 util.WaitFor(IsReadyStateInteractiveOrBetter, timeout) |
| 78 |
| 79 def LoginNeeded(self, credentials_type): |
| 80 self.browser.LoginNeeded(credentials_type, self) |
| 81 |
| 82 def LoginNoLongerNeeded(self, credentials_type): |
| 83 self.browser.LoginNoLongerNeeded(credentials_type, self) |
| OLD | NEW |