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

Side by Side Diff: chrome/browser/ui/exclusive_access/fullscreen_controller_browsertest.cc

Issue 903683005: Always prompt for permission on fullscreen and mouse lock on file:// URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Mac UI for fullscreen on file:// URLs Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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 "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_commands.h" 8 #include "chrome/browser/ui/browser_commands.h"
9 #include "chrome/browser/ui/browser_tabstrip.h" 9 #include "chrome/browser/ui/browser_tabstrip.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
11 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" 11 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h"
12 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" 12 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h"
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" 13 #include "chrome/browser/ui/tabs/tab_strip_model.h"
14 #include "chrome/test/base/ui_test_utils.h"
14 #include "content/public/browser/render_view_host.h" 15 #include "content/public/browser/render_view_host.h"
msw 2015/02/12 00:07:59 nit: this and some other headers may not be used a
estark 2015/02/12 02:33:10 Done.
15 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
16 #include "content/public/common/url_constants.h" 17 #include "content/public/common/url_constants.h"
17 #include "content/public/test/test_navigation_observer.h" 18 #include "content/public/test/test_navigation_observer.h"
18 19
19 using url::kAboutBlankURL; 20 using url::kAboutBlankURL;
msw 2015/02/12 00:07:59 nit: remove this, uses of kAboutBlankURL qualify t
20 using content::WebContents; 21 using content::WebContents;
21 using ui::PAGE_TRANSITION_TYPED; 22 using ui::PAGE_TRANSITION_TYPED;
22 23
23 class FullscreenControllerBrowserTest: public FullscreenControllerTest { 24 class FullscreenControllerBrowserTest: public FullscreenControllerTest {
msw 2015/02/12 00:07:59 nit: remove this (it's also missing a space before
24 }; 25 };
25 26
26 IN_PROC_BROWSER_TEST_F(FullscreenControllerTest, 27 IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
27 PendingMouseLockExitsOnTabSwitch) { 28 PendingMouseLockExitsOnTabSwitch) {
28 AddTabAtIndex(0, GURL(url::kAboutBlankURL), PAGE_TRANSITION_TYPED); 29 AddTabAtIndex(0, GURL(url::kAboutBlankURL), PAGE_TRANSITION_TYPED);
29 AddTabAtIndex(0, GURL(url::kAboutBlankURL), PAGE_TRANSITION_TYPED); 30 AddTabAtIndex(0, GURL(url::kAboutBlankURL), PAGE_TRANSITION_TYPED);
30 WebContents* tab1 = browser()->tab_strip_model()->GetActiveWebContents(); 31 WebContents* tab1 = browser()->tab_strip_model()->GetActiveWebContents();
31 32
32 // Request mouse lock. Bubble is displayed. 33 // Request mouse lock. Bubble is displayed.
33 RequestToLockMouse(true, false); 34 RequestToLockMouse(true, false);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 ASSERT_TRUE(IsFullscreenBubbleDisplayed()); 68 ASSERT_TRUE(IsFullscreenBubbleDisplayed());
68 69
69 // Close tab. Bubble is cleared. 70 // Close tab. Bubble is cleared.
70 { 71 {
71 MouseLockNotificationObserver mouse_lock_observer; 72 MouseLockNotificationObserver mouse_lock_observer;
72 chrome::CloseTab(browser()); 73 chrome::CloseTab(browser());
73 mouse_lock_observer.Wait(); 74 mouse_lock_observer.Wait();
74 } 75 }
75 ASSERT_FALSE(IsFullscreenBubbleDisplayed()); 76 ASSERT_FALSE(IsFullscreenBubbleDisplayed());
76 } 77 }
78
79 IN_PROC_BROWSER_TEST_F(FullscreenControllerTest, MouseLockOnFileURL) {
msw 2015/02/12 00:07:59 You may want to add a file URL test case to fullsc
80 static const base::FilePath::CharType* kEmptyFile =
81 FILE_PATH_LITERAL("empty.html");
82 GURL file_url(ui_test_utils::GetTestUrl(
83 base::FilePath(base::FilePath::kCurrentDirectory),
84 base::FilePath(kEmptyFile)));
85 AddTabAtIndex(0, file_url, PAGE_TRANSITION_TYPED);
86 RequestToLockMouse(true, false);
87 ASSERT_TRUE(IsFullscreenBubbleDisplayed());
88 ASSERT_TRUE(IsFullscreenBubbleDisplayingButtons());
89 }
90
91 IN_PROC_BROWSER_TEST_F(FullscreenControllerTest, FullscreenOnFileURL) {
92 static const base::FilePath::CharType* kEmptyFile =
93 FILE_PATH_LITERAL("empty.html");
94 GURL file_url(ui_test_utils::GetTestUrl(
95 base::FilePath(base::FilePath::kCurrentDirectory),
96 base::FilePath(kEmptyFile)));
97 AddTabAtIndex(0, file_url, PAGE_TRANSITION_TYPED);
98 RequestToLockMouse(true, false);
99 ASSERT_TRUE(IsFullscreenBubbleDisplayed());
100 ASSERT_TRUE(IsFullscreenBubbleDisplayingButtons());
101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698