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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 msg='Mouse lock bubble did not clear when tab lost focus.') | 412 msg='Mouse lock bubble did not clear when tab lost focus.') |
413 | 413 |
414 def testTabFSExitWhenNavBackToPrevPage(self): | 414 def testTabFSExitWhenNavBackToPrevPage(self): |
415 """Verify tab fullscreen exit when navigating back to previous page. | 415 """Verify tab fullscreen exit when navigating back to previous page. |
416 | 416 |
417 This test navigates to a new page while in tab fullscreen mode by using | 417 This test navigates to a new page while in tab fullscreen mode by using |
418 GoBack() to navigate to the previous google.html page. | 418 GoBack() to navigate to the previous google.html page. |
419 """ | 419 """ |
420 self.NavigateToURL(self.GetHttpURLForDataPath('google', 'google.html')) | 420 self.NavigateToURL(self.GetHttpURLForDataPath('google', 'google.html')) |
421 self._InitiateTabFullscreen() | 421 self._InitiateTabFullscreen() |
422 self.GetBrowserWindow().GetTab().GoBack() | 422 self.TabGoBack() |
423 self.assertFalse( | 423 self.assertFalse( |
424 self.IsFullscreenForTab(), | 424 self.IsFullscreenForTab(), |
425 msg='Tab fullscreen did not exit when navigating to a new page.') | 425 msg='Tab fullscreen did not exit when navigating to a new page.') |
426 | 426 |
427 def testTabFSExitWhenNavToNewPage(self): | 427 def testTabFSExitWhenNavToNewPage(self): |
428 """Verify tab fullscreen exit when navigating to a new website. | 428 """Verify tab fullscreen exit when navigating to a new website. |
429 | 429 |
430 This test navigates to a new website while in tab fullscreen. | 430 This test navigates to a new website while in tab fullscreen. |
431 """ | 431 """ |
432 self._InitiateTabFullscreen() | 432 self._InitiateTabFullscreen() |
(...skipping 17 matching lines...) Expand all Loading... |
450 def testMLExitWhenNavBackToPrevPage(self): | 450 def testMLExitWhenNavBackToPrevPage(self): |
451 """Verify mouse lock exit when navigating back to previous page. | 451 """Verify mouse lock exit when navigating back to previous page. |
452 | 452 |
453 This test navigates to a new page while mouse lock is activated by using | 453 This test navigates to a new page while mouse lock is activated by using |
454 GoBack() to navigate to the previous google.html page. | 454 GoBack() to navigate to the previous google.html page. |
455 """ | 455 """ |
456 self.NavigateToURL(self.GetHttpURLForDataPath('google', 'google.html')) | 456 self.NavigateToURL(self.GetHttpURLForDataPath('google', 'google.html')) |
457 lock_result = self._EnableAndReturnLockMouseResult() | 457 lock_result = self._EnableAndReturnLockMouseResult() |
458 self.assertEqual( | 458 self.assertEqual( |
459 lock_result, 'success', msg='Mouse is not locked.') | 459 lock_result, 'success', msg='Mouse is not locked.') |
460 self.GetBrowserWindow().GetTab().GoBack() | 460 self.TabGoBack() |
461 self.assertFalse( | 461 self.assertFalse( |
462 self.IsMouseLocked(), | 462 self.IsMouseLocked(), |
463 msg='Mouse lock did not exit when navigating to the prev page.') | 463 msg='Mouse lock did not exit when navigating to the prev page.') |
464 | 464 |
465 def testMLExitWhenNavToNewPage(self): | 465 def testMLExitWhenNavToNewPage(self): |
466 """Verify mouse lock exit when navigating to a new website.""" | 466 """Verify mouse lock exit when navigating to a new website.""" |
467 lock_result = self._EnableAndReturnLockMouseResult() | 467 lock_result = self._EnableAndReturnLockMouseResult() |
468 self.assertEqual( | 468 self.assertEqual( |
469 lock_result, 'success', msg='Mouse is not locked.') | 469 lock_result, 'success', msg='Mouse is not locked.') |
470 self.NavigateToURL(self.GetHttpURLForDataPath('google', 'google.html')) | 470 self.NavigateToURL(self.GetHttpURLForDataPath('google', 'google.html')) |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 self.assertTrue(self.WaitUntil(self.IsFullscreenForTab)) | 608 self.assertTrue(self.WaitUntil(self.IsFullscreenForTab)) |
609 self._EnableMouseLockMode() | 609 self._EnableMouseLockMode() |
610 raw_input( | 610 raw_input( |
611 '1. Move the mouse, see movement data being received by the page.\ | 611 '1. Move the mouse, see movement data being received by the page.\ |
612 2. Press ESC key.\ | 612 2. Press ESC key.\ |
613 3. Lock the mouse without going fullscreen. Click lockMouse1() button.\ | 613 3. Lock the mouse without going fullscreen. Click lockMouse1() button.\ |
614 Verify: The mouse movement events should work immediately.') | 614 Verify: The mouse movement events should work immediately.') |
615 | 615 |
616 if __name__ == '__main__': | 616 if __name__ == '__main__': |
617 pyauto_functional.Main() | 617 pyauto_functional.Main() |
OLD | NEW |