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 shutil | 9 import shutil |
9 | 10 |
10 import pyauto_functional # Must be imported before pyauto | 11 import pyauto_functional # Must be imported before pyauto |
11 import pyauto | 12 import pyauto |
12 import test_utils | 13 import test_utils |
13 from selenium.webdriver.common.keys import Keys | 14 from selenium.webdriver.common.keys import Keys |
15 from webdriver_pages import settings | |
14 | 16 |
15 | 17 |
16 class FullscreenMouselockTest(pyauto.PyUITest): | 18 class FullscreenMouselockTest(pyauto.PyUITest): |
17 """TestCase for Fullscreen and Mouse Lock.""" | 19 """TestCase for Fullscreen and Mouse Lock.""" |
18 | 20 |
21 def setUp(self): | |
22 pyauto.PyUITest.setUp(self) | |
23 self._driver = self.NewWebDriver() | |
24 # Get the hostname pattern (e.g. http://127.0.0.1:57622). | |
25 self._hostname_pattern = ( | |
26 re.sub('/files/$', '', self.GetHttpURLForDataPath(''))) | |
27 | |
28 def Debug(self): | |
29 """Test method for experimentation. | |
30 | |
31 This method will not run automatically. | |
32 """ | |
33 self._driver = self.NewWebDriver() | |
Nirnimesh
2012/04/23 19:16:26
Why repeat?
dyu1
2012/04/23 19:26:43
Done.
| |
34 page = settings.ContentSettingsPage.FromNavigation(self._driver) | |
35 import pdb | |
36 pdb.set_trace() | |
37 | |
19 def ExtraChromeFlags(self): | 38 def ExtraChromeFlags(self): |
20 """Ensures Chrome is launched with custom flags. | 39 """Ensures Chrome is launched with custom flags. |
21 | 40 |
22 Returns: | 41 Returns: |
23 A list of extra flags to pass to Chrome when it is launched. | 42 A list of extra flags to pass to Chrome when it is launched. |
24 """ | 43 """ |
25 # Extra flag needed by scroll performance tests. | 44 # Extra flag needed by scroll performance tests. |
26 return super(FullscreenMouselockTest, | 45 return super(FullscreenMouselockTest, |
27 self).ExtraChromeFlags() + ['--enable-pointer-lock'] | 46 self).ExtraChromeFlags() + ['--enable-pointer-lock'] |
28 | 47 |
29 def testFullScreenMouseLockHooks(self): | 48 def testFullScreenMouseLockHooks(self): |
30 """Verify fullscreen and mouse lock automation hooks work.""" | 49 """Verify fullscreen and mouse lock automation hooks work.""" |
31 | |
32 from webdriver_pages import settings | |
33 from webdriver_pages.settings import Behaviors, ContentTypes | |
34 driver = self.NewWebDriver() | |
35 self.NavigateToURL(self.GetHttpURLForDataPath( | 50 self.NavigateToURL(self.GetHttpURLForDataPath( |
36 'fullscreen_mouselock', 'fullscreen_mouselock.html')) | 51 'fullscreen_mouselock', 'fullscreen_mouselock.html')) |
37 | 52 |
38 # Starting off we shouldn't be fullscreen | 53 # Starting off we shouldn't be fullscreen |
39 self.assertFalse(self.IsFullscreenForBrowser()) | 54 self.assertFalse(self.IsFullscreenForBrowser()) |
40 self.assertFalse(self.IsFullscreenForTab()) | 55 self.assertFalse(self.IsFullscreenForTab()) |
41 | 56 |
42 # Go fullscreen | 57 # Go fullscreen |
43 driver.find_element_by_id('enterFullscreen').click() | 58 self._driver.find_element_by_id('enterFullscreen').click() |
44 self.assertTrue(self.WaitUntil(self.IsFullscreenForTab)) | 59 self.assertTrue(self.WaitUntil(self.IsFullscreenForTab)) |
45 | 60 |
46 # Bubble should be up prompting to allow fullscreen | 61 # Bubble should be up prompting to allow fullscreen |
47 self.assertTrue(self.IsFullscreenBubbleDisplayed()) | 62 self.assertTrue(self.IsFullscreenBubbleDisplayed()) |
48 self.assertTrue(self.IsFullscreenBubbleDisplayingButtons()) | 63 self.assertTrue(self.IsFullscreenBubbleDisplayingButtons()) |
49 self.assertTrue(self.IsFullscreenPermissionRequested()) | 64 self.assertTrue(self.IsFullscreenPermissionRequested()) |
50 | 65 |
51 # Accept bubble, it should go away. | 66 # Accept bubble, it should go away. |
52 self.AcceptCurrentFullscreenOrMouseLockRequest() | 67 self.AcceptCurrentFullscreenOrMouseLockRequest() |
53 self.assertTrue(self.WaitUntil( | 68 self.assertTrue(self.WaitUntil( |
54 lambda: not self.IsFullscreenBubbleDisplayingButtons())) | 69 lambda: not self.IsFullscreenBubbleDisplayingButtons())) |
55 | 70 |
56 # Try to lock mouse, it won't lock yet but permision will be requested. | 71 # Try to lock mouse, it won't lock yet but permision will be requested. |
57 self.assertFalse(self.IsMouseLocked()) | 72 self.assertFalse(self.IsMouseLocked()) |
58 driver.find_element_by_id('lockMouse1').click() | 73 self._driver.find_element_by_id('lockMouse1').click() |
59 self.assertTrue(self.WaitUntil(self.IsMouseLockPermissionRequested)) | 74 self.assertTrue(self.WaitUntil(self.IsMouseLockPermissionRequested)) |
60 self.assertFalse(self.IsMouseLocked()) | 75 self.assertFalse(self.IsMouseLocked()) |
61 | 76 |
62 # Deny mouse lock. | 77 # Deny mouse lock. |
63 self.DenyCurrentFullscreenOrMouseLockRequest() | 78 self.DenyCurrentFullscreenOrMouseLockRequest() |
64 self.assertTrue(self.WaitUntil( | 79 self.assertTrue(self.WaitUntil( |
65 lambda: not self.IsFullscreenBubbleDisplayingButtons())) | 80 lambda: not self.IsFullscreenBubbleDisplayingButtons())) |
66 self.assertFalse(self.IsMouseLocked()) | 81 self.assertFalse(self.IsMouseLocked()) |
67 | 82 |
68 # Try mouse lock again, and accept it. | 83 # Try mouse lock again, and accept it. |
69 driver.find_element_by_id('lockMouse1').click() | 84 self._driver.find_element_by_id('lockMouse1').click() |
70 self.assertTrue(self.WaitUntil(self.IsMouseLockPermissionRequested)) | 85 self.assertTrue(self.WaitUntil(self.IsMouseLockPermissionRequested)) |
71 self.AcceptCurrentFullscreenOrMouseLockRequest() | 86 self.AcceptCurrentFullscreenOrMouseLockRequest() |
72 self.assertTrue(self.WaitUntil(self.IsMouseLocked)) | 87 self.assertTrue(self.WaitUntil(self.IsMouseLocked)) |
73 | 88 |
74 # The following doesn't work - as sending the key to the input field isn't | 89 # The following doesn't work - as sending the key to the input field isn't |
75 # picked up by the browser. :( Need an alternative way. | 90 # picked up by the browser. :( Need an alternative way. |
76 # | 91 # |
77 # # Ideally we wouldn't target a specific element, we'd just send keys to | 92 # # Ideally we wouldn't target a specific element, we'd just send keys to |
78 # # whatever the current keyboard focus was. | 93 # # whatever the current keyboard focus was. |
79 # keys_target = driver.find_element_by_id('sendKeysTarget') | 94 # keys_target = driver.find_element_by_id('sendKeysTarget') |
80 # | 95 # |
81 # # ESC key should exit fullscreen and mouse lock. | 96 # # ESC key should exit fullscreen and mouse lock. |
82 # | 97 # |
83 # print "# ESC key should exit fullscreen and mouse lock." | 98 # print "# ESC key should exit fullscreen and mouse lock." |
84 # keys_target.send_keys(Keys.ESCAPE) | 99 # keys_target.send_keys(Keys.ESCAPE) |
85 # self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForBrowser())) | 100 # self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForBrowser())) |
86 # self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForTab())) | 101 # self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForTab())) |
87 # self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked())) | 102 # self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked())) |
88 # | 103 # |
89 # # Check we can go browser fullscreen | 104 # # Check we can go browser fullscreen |
90 # print "# Check we can go browser fullscreen" | 105 # print "# Check we can go browser fullscreen" |
91 # keys_target.send_keys(Keys.F11) | 106 # keys_target.send_keys(Keys.F11) |
92 # self.assertTrue(self.WaitUntil(self.IsFullscreenForBrowser)) | 107 # self.assertTrue(self.WaitUntil(self.IsFullscreenForBrowser)) |
93 | 108 |
109 def _LaunchFSAndExpectPrompt(self, button_action='enterFullscreen'): | |
110 """Helper function to launch fullscreen and expect a prompt. | |
111 | |
112 Fullscreen is initiated and a bubble prompt appears asking to allow or | |
113 cancel from fullscreen mode. The actual fullscreen mode doesn't take place | |
114 until after approving the prompt. | |
115 | |
116 If the helper is not successful then the tests will fail. | |
117 | |
118 Args: | |
119 button_action: The button id to click to initiate an action. Default is to | |
120 click enterFullscreen. | |
121 """ | |
122 self.NavigateToURL(self.GetHttpURLForDataPath( | |
123 'fullscreen_mouselock', 'fullscreen_mouselock.html')) | |
124 # Should not be in fullscreen mode during initial launch. | |
125 self.assertFalse(self.IsFullscreenForBrowser()) | |
126 self.assertFalse(self.IsFullscreenForTab()) | |
127 # Go into fullscreen mode. | |
128 self._driver.find_element_by_id(button_action).click() | |
129 self.assertTrue(self.WaitUntil(self.IsFullscreenForTab)) | |
130 # Bubble should display prompting to allow fullscreen. | |
131 self.assertTrue(self.IsFullscreenPermissionRequested()) | |
132 | |
133 def _InitiateBrowserFullscreen(self): | |
134 """Helper function that initiates browser fullscreen.""" | |
135 self.NavigateToURL(self.GetHttpURLForDataPath( | |
136 'fullscreen_mouselock', 'fullscreen_mouselock.html')) | |
137 # Should not be in fullscreen mode during initial launch. | |
138 self.assertFalse(self.IsFullscreenForBrowser()) | |
139 self.assertFalse(self.IsFullscreenForTab()) | |
140 # Initiate browser fullscreen. | |
141 self.ApplyAccelerator(pyauto.IDC_FULLSCREEN) | |
142 self.assertTrue(self.WaitUntil(self.IsFullscreenForBrowser)) | |
143 self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForTab())) | |
144 self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked())) | |
145 | |
146 def _AcceptFullscreenOrMouseLockRequest(self): | |
147 """Helper function to accept fullscreen or mouse lock request.""" | |
148 self.AcceptCurrentFullscreenOrMouseLockRequest() | |
149 self.assertTrue(self.WaitUntil( | |
150 lambda: not self.IsFullscreenBubbleDisplayingButtons())) | |
151 | |
152 def _EnableFullscreenAndMouseLockMode(self): | |
153 """Helper function to enable fullscreen and mouse lock mode.""" | |
154 self._LaunchFSAndExpectPrompt(button_action='enterFullscreenAndLockMouse1') | |
155 # Allow fullscreen. | |
156 self.AcceptCurrentFullscreenOrMouseLockRequest() | |
157 # The wait is needed due to crbug.com/123396. Should be able to click the | |
158 # fullscreen and mouselock button and be both accepted in a single action. | |
159 self.assertTrue(self.WaitUntil(self.IsMouseLockPermissionRequested)) | |
160 # Allow mouse lock. | |
161 self.AcceptCurrentFullscreenOrMouseLockRequest() | |
162 self.assertTrue(self.WaitUntil(self.IsMouseLocked)) | |
163 | |
164 def _EnableMouseLockMode(self, button_action='lockMouse1'): | |
165 """Helper function to enable mouse lock mode. | |
166 | |
167 For now, to lock the mouse, the browser needs to be in fullscreen mode. | |
168 | |
169 Args: | |
170 button_action: The button id to click to initiate an action. Default is to | |
171 click lockMouse1. | |
172 """ | |
173 self._driver.find_element_by_id(button_action).click() | |
174 self.assertTrue(self.IsMouseLockPermissionRequested()) | |
175 self.AcceptCurrentFullscreenOrMouseLockRequest() | |
176 self.assertTrue(self.IsMouseLocked()) | |
177 | |
178 def testPrefsLineEntryForFullscreenAllowed(self): | |
Nirnimesh
2012/04/23 19:16:26
LineEntry -> Prefs
dyu1
2012/04/23 19:26:43
Done.
| |
179 """Verify line entry when fullscreen is allowed.""" | |
Nirnimesh
2012/04/23 19:16:26
it's not clear what you mean by 'line entry'. Chan
dyu1
2012/04/23 19:26:43
Done.
| |
180 self._LaunchFSAndExpectPrompt() | |
181 self._AcceptFullscreenOrMouseLockRequest() | |
182 content_settings = ( | |
183 self.GetPrefsInfo().Prefs()['profile']['content_settings']) | |
184 self.assertEqual( | |
185 {self._hostname_pattern + ',*': {'fullscreen': 1}}, # Allow hostname. | |
186 content_settings['pattern_pairs'], | |
187 msg='Saved hostname pattern does not match expected pattern.') | |
188 | |
189 def testPrefsLineEntryForFullscreenExit(self): | |
Nirnimesh
2012/04/23 19:16:26
LineEntry -> Prefs
dyu1
2012/04/23 19:26:43
Done.
| |
190 """Verify line entry is empty when exit fullscreen mode before allowing.""" | |
191 self._LaunchFSAndExpectPrompt() | |
192 self._driver.find_element_by_id('exitFullscreen').click() | |
193 # Verify exit from fullscreen mode. | |
194 self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForTab())) | |
195 content_settings = ( | |
196 self.GetPrefsInfo().Prefs()['profile']['content_settings']) | |
197 self.assertEqual( | |
198 {}, content_settings['pattern_pairs'], | |
199 msg='Line entry saved when there should be none.') | |
200 | |
201 def testPatternsForFSAndML(self): | |
202 """Verify hostname pattern and behavior for allowed mouse cursor lock. | |
203 | |
204 To lock the mouse, the browser needs to be in fullscreen mode. | |
205 """ | |
206 self._EnableFullscreenAndMouseLockMode() | |
207 self._EnableMouseLockMode() | |
208 expected_pattern = ( | |
209 {self._hostname_pattern + ',*': {'fullscreen': 1, 'mouselock': 1}}) | |
210 content_settings = ( | |
211 self.GetPrefsInfo().Prefs()['profile']['content_settings']) | |
212 self.assertEqual( | |
213 expected_pattern, content_settings['pattern_pairs'], | |
214 msg='Saved hostname and behavior patterns does not match expected.') | |
215 | |
216 def testPatternsForAllowMouseLock(self): | |
217 """Verify hostname pattern and behavior for allowed mouse cursor lock. | |
218 | |
219 Enable fullscreen mode and enable mouse lock separately. | |
220 """ | |
221 self._LaunchFSAndExpectPrompt() | |
222 self.AcceptCurrentFullscreenOrMouseLockRequest() | |
223 self._EnableMouseLockMode() | |
224 expected_pattern = ( | |
225 {self._hostname_pattern + ',*': {'fullscreen': 1, 'mouselock': 1}}) | |
226 content_settings = ( | |
227 self.GetPrefsInfo().Prefs()['profile']['content_settings']) | |
228 self.assertEqual( | |
229 expected_pattern, content_settings['pattern_pairs'], | |
230 msg='Saved hostname and behavior patterns does not match expected.') | |
231 | |
232 def testNoMouseLockRequest(self): | |
233 """Verify mouse lock request does not appear. | |
234 | |
235 When allowing all sites to disable the mouse cursor, the mouse lock request | |
236 bubble should not show. The mouse cursor should be automatically disabled | |
237 when clicking on a disable mouse button. | |
238 """ | |
239 # Allow all sites to disable mouse cursor. | |
240 self.SetPrefs(pyauto.kDefaultContentSettings, {u'mouselock': 1}) | |
241 self._LaunchFSAndExpectPrompt() | |
242 # Allow for fullscreen mode. | |
243 self._AcceptFullscreenOrMouseLockRequest() | |
244 self._driver.set_script_timeout(2) | |
245 # Receive callback status (success or failure) from javascript that the | |
246 # click has registered and the mouse lock status has changed. | |
247 lock_result = self._driver.execute_async_script( | |
248 'lockMouse1(arguments[arguments.length - 1])') | |
249 self.assertEqual(lock_result, 'success', msg='Mouse lock unsuccessful.') | |
250 self.assertTrue(self.WaitUntil( | |
251 lambda: not self.IsMouseLockPermissionRequested())) | |
252 self.assertTrue(self.IsMouseLocked()) | |
253 | |
254 def testUnableToLockMouse(self): | |
255 """Verify mouse lock is disabled. | |
256 | |
257 When not allowing any site to disable the mouse cursor, the mouse lock | |
258 request bubble should not show and the mouse cursor should not be disabled. | |
259 """ | |
260 # Do not allow any site to disable mouse cursor. | |
261 self.SetPrefs(pyauto.kDefaultContentSettings, {u'mouselock': 2}) | |
262 self._LaunchFSAndExpectPrompt() | |
263 # Allow for fullscreen mode. | |
264 self._AcceptFullscreenOrMouseLockRequest() | |
265 self._driver.set_script_timeout(2) | |
266 # Receive callback status (success or failure) from javascript that the | |
267 # click has registered and the mouse lock status has changed. | |
268 lock_result = self._driver.execute_async_script( | |
269 'lockMouse1(arguments[arguments.length - 1])') | |
270 self.assertEqual(lock_result, 'failure', msg='Mouse locked unexpectedly.') | |
271 self.assertTrue(self.WaitUntil( | |
272 lambda: not self.IsMouseLockPermissionRequested())) | |
273 self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked())) | |
274 | |
275 def testEnterTabFSWhileInBrowserFS(self): | |
276 """Verify able to enter into tab fullscreen while in browser fullscreen.""" | |
277 self._InitiateBrowserFullscreen() | |
278 # Initiate tab fullscreen. | |
279 self._driver.find_element_by_id('enterFullscreen').click() | |
280 self.assertTrue(self.WaitUntil(lambda: self.IsFullscreenForTab())) | |
281 self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked())) | |
282 | |
283 def testNoMouseLockInBrowserFS(self): | |
284 """Verify mouse lock can't be activated in browser fullscreen. | |
285 | |
286 Later on when windowed-mode mouse lock is allowed, this test will adjust to | |
287 verify that mouse lock in browser fullscreen requires an allow prompt, even | |
288 when there is a content setting for Allow. | |
289 """ | |
290 self._InitiateBrowserFullscreen() | |
291 self._driver.find_element_by_id('lockMouse1').click() | |
292 self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked()), | |
293 msg='Mouse is locked in browser fullscreen.') | |
294 | |
295 def testMouseLockExitWhenBrowserLoseFocus(self): | |
296 """Verify mouse lock breaks when browser loses focus. | |
297 | |
298 Mouse lock breaks when the focus is placed on another new window. | |
299 """ | |
300 self.NavigateToURL(self.GetHttpURLForDataPath( | |
301 'fullscreen_mouselock', 'fullscreen_mouselock.html')) | |
302 self._driver.find_element_by_id('enterFullscreen').click() | |
303 self._driver.find_element_by_id('lockMouse1').click() | |
304 self.AcceptCurrentFullscreenOrMouseLockRequest() | |
305 # Open a new window to shift focus away. | |
306 self.OpenNewBrowserWindow(True) | |
307 self.assertTrue(self.WaitUntil(lambda: self.IsFullscreenForTab())) | |
308 self.assertTrue(self.WaitUntil(lambda: not self.IsMouseLocked()), | |
309 msg='Alert dialog did not break mouse lock.') | |
310 | |
311 def ExitTabFSToBrowserFS(self): | |
312 """Verify exiting tab fullscreen leaves browser in browser fullscreen. | |
313 | |
314 The browser initiates browser fullscreen, then initiates tab fullscreen. The | |
315 test verifies that existing tab fullscreen by simulating ESC key press or | |
316 clicking the js function to exitFullscreen() will exit the tab fullscreen | |
317 leaving browser fullscreen intact. | |
318 """ | |
319 self._InitiateBrowserFullscreen() | |
320 # Initiate tab fullscreen. | |
321 self._driver.find_element_by_id('enterFullscreen').click() | |
322 self.assertTrue(self.WaitUntil(lambda: self.IsFullscreenForTab())) | |
323 # Require manual intervention to send ESC key due to crbug.com/123930. | |
324 import time | |
Nirnimesh
2012/04/23 19:16:26
move to the top of this file
dyu1
2012/04/23 19:26:43
Done.
| |
325 print "Press ESC key to exit tab fullscreen." | |
326 time.sleep(5) | |
327 self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForTab())) | |
328 self.assertTrue(self.WaitUntil(lambda: self.IsFullscreenForBrowser()), | |
329 msg='Not in browser fullscreen mode.') | |
330 | |
331 self._driver.find_element_by_id('enterFullscreen').click() | |
332 self.assertTrue(self.WaitUntil(lambda: self.IsFullscreenForTab())) | |
333 # Exit tab fullscreen by clicking button exitFullscreen(). | |
334 self._driver.find_element_by_id('exitFullscreen').click() | |
335 self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForTab())) | |
336 self.assertTrue(self.WaitUntil(lambda: self.IsFullscreenForBrowser()), | |
337 msg='Not in browser fullscreen mode.') | |
338 | |
339 def F11KeyExistsTabAndBrowserFS(self): | |
340 """Verify existing tab fullscreen exists all fullscreen modes. | |
341 | |
342 The browser initiates browser fullscreen, then initiates tab fullscreen. The | |
343 test verifies that existing tab fullscreen by simulating F11 key press or | |
344 CMD + SHIFT + F keys on the Mac will exit the tab fullscreen and the | |
345 browser fullscreen. | |
346 """ | |
347 self._InitiateBrowserFullscreen() | |
348 # Initiate tab fullscreen. | |
349 self._driver.find_element_by_id('enterFullscreen').click() | |
350 self.assertTrue(self.WaitUntil(lambda: self.IsFullscreenForTab())) | |
351 # Require manual intervention to send F11 key due to crbug.com/123930. | |
352 import time | |
353 print "Press F11 key to exit tab fullscreen." | |
354 time.sleep(5) | |
355 self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForTab())) | |
356 self.assertTrue(self.WaitUntil(lambda: not self.IsFullscreenForBrowser()), | |
357 msg='Browser is in fullscreen mode.') | |
358 | |
359 def SearchForTextOutsideOfContainer(self): | |
360 """Verify text outside of container is not visible when fullscreen. | |
361 | |
362 Verify this test manually until there is a way to find text on screen | |
363 without using FindInPage(). | |
364 | |
365 The text that is outside of the fullscreen container should only be visible | |
366 when fullscreen is off. The text should not be visible while in fullscreen | |
367 mode. | |
368 """ | |
369 self.NavigateToURL(self.GetHttpURLForDataPath( | |
370 'fullscreen_mouselock', 'fullscreen_mouselock.html')) | |
371 # Should not be in fullscreen mode during initial launch. | |
372 self.assertFalse(self.IsFullscreenForBrowser()) | |
373 self.assertFalse(self.IsFullscreenForTab()) | |
374 self.assertTrue( | |
375 self.WaitUntil(lambda: self.FindInPage( | |
376 'This text is outside of the container')['match_count'], | |
377 expect_retval=1)) | |
378 # Go into fullscreen mode. | |
379 self._driver.find_element_by_id('enterFullscreen').click() | |
380 self.assertTrue(self.WaitUntil(self.IsFullscreenForTab)) | |
381 # TODO(dyu): find a way to verify on screen text instead of using | |
382 # FindInPage() which searches for text in the HTML. | |
383 | |
94 | 384 |
95 if __name__ == '__main__': | 385 if __name__ == '__main__': |
96 pyauto_functional.Main() | 386 pyauto_functional.Main() |
OLD | NEW |