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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 | 357 |
358 def testMouseLockLostOnReload(self): | 358 def testMouseLockLostOnReload(self): |
359 """Verify mouse lock is lost on page reload.""" | 359 """Verify mouse lock is lost on page reload.""" |
360 self.NavigateToURL(self.GetHttpURLForDataPath( | 360 self.NavigateToURL(self.GetHttpURLForDataPath( |
361 'fullscreen_mouselock', 'fullscreen_mouselock.html')) | 361 'fullscreen_mouselock', 'fullscreen_mouselock.html')) |
362 self._EnableMouseLockMode() | 362 self._EnableMouseLockMode() |
363 self.ReloadActiveTab() | 363 self.ReloadActiveTab() |
364 self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked()), | 364 self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked()), |
365 msg='Mouse lock did not break when page is reloaded.') | 365 msg='Mouse lock did not break when page is reloaded.') |
366 | 366 |
367 def testNoMLBubbleWhenTabLoseFocus(self): | |
368 """Verify mouse lock bubble goes away when tab loses focus.""" | |
369 self.NavigateToURL(self.GetHttpURLForDataPath( | |
370 'fullscreen_mouselock', 'fullscreen_mouselock.html')) | |
371 self._driver.find_element_by_id('lockMouse1').click() | |
372 self.assertTrue(self.WaitUntil(self.IsMouseLockPermissionRequested)) | |
373 self.RunCommand(pyauto.IDC_NEW_TAB) | |
Nirnimesh
2012/06/09 08:09:06
Use AppendTab instead
dyu1
2012/06/12 17:01:21
Done.
| |
374 self.assertTrue(self.WaitUntil( | |
375 lambda: not self.IsFullscreenBubbleDisplayingButtons()), | |
376 msg='Mouse lock bubble did not clear when tab lost focus.') | |
377 | |
367 def ExitTabFSToBrowserFS(self): | 378 def ExitTabFSToBrowserFS(self): |
368 """Verify exiting tab fullscreen leaves browser in browser fullscreen. | 379 """Verify exiting tab fullscreen leaves browser in browser fullscreen. |
369 | 380 |
370 This test is semi-automated. | 381 This test is semi-automated. |
371 | 382 |
372 The browser initiates browser fullscreen, then initiates tab fullscreen. The | 383 The browser initiates browser fullscreen, then initiates tab fullscreen. The |
373 test verifies that existing tab fullscreen by simulating ESC key press or | 384 test verifies that existing tab fullscreen by simulating ESC key press or |
374 clicking the js function to exitFullscreen() will exit the tab fullscreen | 385 clicking the js function to exitFullscreen() will exit the tab fullscreen |
375 leaving browser fullscreen intact. | 386 leaving browser fullscreen intact. |
376 """ | 387 """ |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 self.NavigateToURL(url2, 0, 1) | 476 self.NavigateToURL(url2, 0, 1) |
466 self._driver.switch_to_window(tab2) | 477 self._driver.switch_to_window(tab2) |
467 self._EnableMouseLockMode() # Lock mouse in tab 2. | 478 self._EnableMouseLockMode() # Lock mouse in tab 2. |
468 raw_input('Manually move the mouse cursor on the page in tab 2. Shift+Tab \ | 479 raw_input('Manually move the mouse cursor on the page in tab 2. Shift+Tab \ |
469 into tab 1, click on lockMouse1() button, and move the mouse \ | 480 into tab 1, click on lockMouse1() button, and move the mouse \ |
470 cursor on the page in tab 1. Verify mouse movement is smooth.') | 481 cursor on the page in tab 1. Verify mouse movement is smooth.') |
471 | 482 |
472 | 483 |
473 if __name__ == '__main__': | 484 if __name__ == '__main__': |
474 pyauto_functional.Main() | 485 pyauto_functional.Main() |
OLD | NEW |