| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 import shutil | 9 import shutil |
| 10 import time | 10 import time |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 332 |
| 333 This test uses javascript to initiate exit of tab fullscreen after mouse | 333 This test uses javascript to initiate exit of tab fullscreen after mouse |
| 334 lock success callback. | 334 lock success callback. |
| 335 """ | 335 """ |
| 336 self._LaunchFSAndExpectPrompt() | 336 self._LaunchFSAndExpectPrompt() |
| 337 self._driver.set_script_timeout(2) | 337 self._driver.set_script_timeout(2) |
| 338 lock_result = self._driver.execute_script('lockMouse1AndSetLockResult()') | 338 lock_result = self._driver.execute_script('lockMouse1AndSetLockResult()') |
| 339 self.assertTrue( | 339 self.assertTrue( |
| 340 self.WaitUntil(lambda: self.IsMouseLockPermissionRequested())) | 340 self.WaitUntil(lambda: self.IsMouseLockPermissionRequested())) |
| 341 self.AcceptCurrentFullscreenOrMouseLockRequest() | 341 self.AcceptCurrentFullscreenOrMouseLockRequest() |
| 342 self.assertTrue(self.WaitUntil(self.IsMouseLocked)) |
| 342 # Waits until lock_result gets 'success' or 'failure'. | 343 # Waits until lock_result gets 'success' or 'failure'. |
| 343 lock_result = self._driver.execute_script('return lock_result') | 344 lock_result = self._driver.execute_script('return lock_result') |
| 344 self.assertEqual( | 345 self.assertEqual( |
| 345 lock_result, 'success', msg='Mouse is not locked.') | 346 lock_result, 'success', msg='Mouse is not locked.') |
| 346 self._driver.execute_script('document.webkitCancelFullScreen()') | 347 self._driver.execute_script('document.webkitCancelFullScreen()') |
| 347 self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForTab()), | 348 self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForTab()), |
| 348 msg='Tab is still in fullscreen.') | 349 msg='Tab is still in fullscreen.') |
| 349 self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked()), | 350 self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked()), |
| 350 msg='Mouse is still locked after exiting fullscreen.') | 351 msg='Mouse is still locked after exiting fullscreen.') |
| 351 | 352 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 self.assertTrue(self.WaitUntil(self.IsFullscreenForTab)) | 609 self.assertTrue(self.WaitUntil(self.IsFullscreenForTab)) |
| 609 self._EnableMouseLockMode() | 610 self._EnableMouseLockMode() |
| 610 raw_input( | 611 raw_input( |
| 611 '1. Move the mouse, see movement data being received by the page.\ | 612 '1. Move the mouse, see movement data being received by the page.\ |
| 612 2. Press ESC key.\ | 613 2. Press ESC key.\ |
| 613 3. Lock the mouse without going fullscreen. Click lockMouse1() button.\ | 614 3. Lock the mouse without going fullscreen. Click lockMouse1() button.\ |
| 614 Verify: The mouse movement events should work immediately.') | 615 Verify: The mouse movement events should work immediately.') |
| 615 | 616 |
| 616 if __name__ == '__main__': | 617 if __name__ == '__main__': |
| 617 pyauto_functional.Main() | 618 pyauto_functional.Main() |
| OLD | NEW |