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