OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h" | 5 #include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
11 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
12 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 12 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
15 #include "content/public/test/test_navigation_observer.h" | 15 #include "content/public/test/test_navigation_observer.h" |
16 | 16 |
17 using content::WebContents; | 17 using content::WebContents; |
18 | 18 |
19 const char FullscreenControllerTest::kFullscreenMouseLockHTML[] = | 19 const char FullscreenControllerTest::kFullscreenMouseLockHTML[] = |
20 "files/fullscreen_mouselock/fullscreen_mouselock.html"; | 20 "files/fullscreen_mouselock/fullscreen_mouselock.html"; |
21 | 21 |
22 void FullscreenControllerTest::SetUpCommandLine(CommandLine* command_line) { | 22 void FullscreenControllerTest::SetUpCommandLine(CommandLine* command_line) { |
23 InProcessBrowserTest::SetUpCommandLine(command_line); | |
24 command_line->AppendSwitch(switches::kEnablePointerLock); | 23 command_line->AppendSwitch(switches::kEnablePointerLock); |
25 } | 24 } |
26 | 25 |
27 void FullscreenControllerTest::ToggleTabFullscreen(bool enter_fullscreen) { | 26 void FullscreenControllerTest::ToggleTabFullscreen(bool enter_fullscreen) { |
28 ToggleTabFullscreen_Internal(enter_fullscreen, true); | 27 ToggleTabFullscreen_Internal(enter_fullscreen, true); |
29 } | 28 } |
30 | 29 |
31 // |ToggleTabFullscreen| should not need to tolerate the transition failing. | 30 // |ToggleTabFullscreen| should not need to tolerate the transition failing. |
32 // Most fullscreen tests run sharded in fullscreen_controller_browsertest.cc | 31 // Most fullscreen tests run sharded in fullscreen_controller_browsertest.cc |
33 // and some flakiness has occurred when calling |ToggleTabFullscreen|, so that | 32 // and some flakiness has occurred when calling |ToggleTabFullscreen|, so that |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 browser()->ToggleFullscreenModeForTab(tab, enter_fullscreen); | 164 browser()->ToggleFullscreenModeForTab(tab, enter_fullscreen); |
166 fullscreen_observer.Wait(); | 165 fullscreen_observer.Wait(); |
167 // Repeat ToggleFullscreenModeForTab until the correct state is entered. | 166 // Repeat ToggleFullscreenModeForTab until the correct state is entered. |
168 // This addresses flakiness on test bots running many fullscreen | 167 // This addresses flakiness on test bots running many fullscreen |
169 // tests in parallel. | 168 // tests in parallel. |
170 } while (retry_until_success && | 169 } while (retry_until_success && |
171 browser()->window()->IsFullscreen() != enter_fullscreen); | 170 browser()->window()->IsFullscreen() != enter_fullscreen); |
172 ASSERT_EQ(browser()->window()->IsFullscreen(), enter_fullscreen); | 171 ASSERT_EQ(browser()->window()->IsFullscreen(), enter_fullscreen); |
173 } | 172 } |
174 } | 173 } |
OLD | NEW |