Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2336)

Unified Diff: chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc

Issue 1570443008: Fix FullscreenController tests with simplified-fullscreen-ui flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FullscreenControllerInteractiveTest: Further fixes for ChromeOS-only tests. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
index 1f3ab909cfd69bcee35d44275e1d4d007e9ce61d..d65ad539c7b1fe98c0b95b45bc4179c19259e126 100644
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
@@ -420,25 +420,31 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest, EscapingMouseLock) {
content::NotificationService::AllSources()));
}
ASSERT_FALSE(IsFullscreenPermissionRequested());
- ASSERT_TRUE(IsMouseLockPermissionRequested());
- // Escape, no prompts should remain.
- SendEscapeToFullscreenController();
- ASSERT_FALSE(IsFullscreenPermissionRequested());
- ASSERT_FALSE(IsMouseLockPermissionRequested());
+ // In simplified mode, the mouse will automatically lock, so we can skip
+ // testing the permission requested and manually accepting.
+ if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) {
+ ASSERT_TRUE(IsMouseLockPermissionRequested());
- // Request to lock the mouse.
- {
- ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait(
- browser(), ui::VKEY_1, false, false, false, false,
- chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
- content::NotificationService::AllSources()));
+ // Escape, no prompts should remain.
+ SendEscapeToFullscreenController();
+ ASSERT_FALSE(IsFullscreenPermissionRequested());
+ ASSERT_FALSE(IsMouseLockPermissionRequested());
+
+ // Request to lock the mouse.
+ {
+ ASSERT_TRUE(ui_test_utils::SendKeyPressAndWait(
+ browser(), ui::VKEY_1, false, false, false, false,
+ chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
+ content::NotificationService::AllSources()));
+ }
+ ASSERT_FALSE(IsFullscreenPermissionRequested());
+ ASSERT_TRUE(IsMouseLockPermissionRequested());
+
+ // Accept mouse lock, confirm it and that there is no prompt.
+ AcceptCurrentFullscreenOrMouseLockRequest();
}
- ASSERT_FALSE(IsFullscreenPermissionRequested());
- ASSERT_TRUE(IsMouseLockPermissionRequested());
- // Accept mouse lock, confirm it and that there is no prompt.
- AcceptCurrentFullscreenOrMouseLockRequest();
ASSERT_TRUE(IsMouseLocked());
ASSERT_FALSE(IsWindowFullscreenForTabOrPending());
ASSERT_FALSE(IsFullscreenPermissionRequested());
@@ -767,11 +773,17 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
content::NotificationService::AllSources()));
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
- ASSERT_TRUE(IsMouseLockPermissionRequested());
- ASSERT_FALSE(IsMouseLocked());
- // Accept mouse lock.
- AcceptCurrentFullscreenOrMouseLockRequest();
+ // In simplified mode, the mouse will automatically lock, so we can skip
+ // testing the permission requested and manually accepting.
+ if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) {
+ ASSERT_TRUE(IsMouseLockPermissionRequested());
+ ASSERT_FALSE(IsMouseLocked());
+
+ // Accept mouse lock.
+ AcceptCurrentFullscreenOrMouseLockRequest();
+ }
+
ASSERT_TRUE(IsMouseLocked());
ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab"));
@@ -795,11 +807,17 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
content::NotificationService::AllSources()));
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
- ASSERT_TRUE(IsMouseLockPermissionRequested());
- ASSERT_FALSE(IsMouseLocked());
- // Accept mouse lock.
- AcceptCurrentFullscreenOrMouseLockRequest();
+ // In simplified mode, the mouse will automatically lock, so we can skip
+ // testing the permission requested and manually accepting.
+ if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) {
+ ASSERT_TRUE(IsMouseLockPermissionRequested());
+ ASSERT_FALSE(IsMouseLocked());
+
+ // Accept mouse lock.
+ AcceptCurrentFullscreenOrMouseLockRequest();
+ }
+
ASSERT_TRUE(IsMouseLocked());
GoBack();
@@ -832,11 +850,17 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
content::NotificationService::AllSources()));
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
- ASSERT_TRUE(IsMouseLockPermissionRequested());
- ASSERT_FALSE(IsMouseLocked());
- // Accept mouse lock.
- AcceptCurrentFullscreenOrMouseLockRequest();
+ // In simplified mode, the mouse will automatically lock, so we can skip
+ // testing the permission requested and manually accepting.
+ if (!ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) {
+ ASSERT_TRUE(IsMouseLockPermissionRequested());
+ ASSERT_FALSE(IsMouseLocked());
+
+ // Accept mouse lock.
+ AcceptCurrentFullscreenOrMouseLockRequest();
+ }
+
ASSERT_TRUE(IsMouseLocked());
// Navigate to url with fragment. Mouse lock should persist.

Powered by Google App Engine
This is Rietveld 408576698