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

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

Issue 11419276: Remove tabstrip wrappers in browser_tabstrip. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk Created 8 years 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 | Annotate | Revision Log
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/utf_string_conversions.h" 6 #include "base/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/fullscreen/fullscreen_controller.h" 11 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
12 #include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h" 12 #include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h"
13 #include "chrome/browser/ui/tabs/tab_strip_model.h"
13 #include "chrome/test/base/ui_test_utils.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"
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 #if defined(OS_MACOSX) 19 #if defined(OS_MACOSX)
19 #include "base/mac/mac_util.h" 20 #include "base/mac/mac_util.h"
20 #endif 21 #endif
21 22
22 using chrome::kAboutBlankURL; 23 using chrome::kAboutBlankURL;
23 using content::WebContents; 24 using content::WebContents;
24 using content::PAGE_TRANSITION_TYPED; 25 using content::PAGE_TRANSITION_TYPED;
25 26
26 class FullscreenControllerBrowserTest: public FullscreenControllerTest { 27 class FullscreenControllerBrowserTest: public FullscreenControllerTest {
27 }; 28 };
28 29
29 IN_PROC_BROWSER_TEST_F(FullscreenControllerTest, 30 IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
30 PendingMouseLockExitsOnTabSwitch) { 31 PendingMouseLockExitsOnTabSwitch) {
31 AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED); 32 AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
32 AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED); 33 AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
33 WebContents* tab1 = chrome::GetActiveWebContents(browser()); 34 WebContents* tab1 = browser()->tab_strip_model()->GetActiveWebContents();
34 35
35 // Request mouse lock. Bubble is displayed. 36 // Request mouse lock. Bubble is displayed.
36 RequestToLockMouse(true, false); 37 RequestToLockMouse(true, false);
37 ASSERT_TRUE(IsFullscreenBubbleDisplayed()); 38 ASSERT_TRUE(IsFullscreenBubbleDisplayed());
38 39
39 // Activate current tab. Mouse lock bubble remains. 40 // Activate current tab. Mouse lock bubble remains.
40 chrome::ActivateTabAt(browser(), 0, true); 41 browser()->tab_strip_model()->ActivateTabAt(0, true);
41 ASSERT_TRUE(IsFullscreenBubbleDisplayed()); 42 ASSERT_TRUE(IsFullscreenBubbleDisplayed());
42 43
43 // Activate second tab. Mouse lock bubble clears. 44 // Activate second tab. Mouse lock bubble clears.
44 { 45 {
45 MouseLockNotificationObserver mouse_lock_observer; 46 MouseLockNotificationObserver mouse_lock_observer;
46 chrome::ActivateTabAt(browser(), 1, true); 47 browser()->tab_strip_model()->ActivateTabAt(1, true);
47 mouse_lock_observer.Wait(); 48 mouse_lock_observer.Wait();
48 } 49 }
49 ASSERT_FALSE(IsFullscreenBubbleDisplayed()); 50 ASSERT_FALSE(IsFullscreenBubbleDisplayed());
50 51
51 // Now, test that closing an unrelated tab does not disturb a request. 52 // Now, test that closing an unrelated tab does not disturb a request.
52 53
53 // Request mouse lock. Bubble is displayed. 54 // Request mouse lock. Bubble is displayed.
54 RequestToLockMouse(true, false); 55 RequestToLockMouse(true, false);
55 ASSERT_TRUE(IsFullscreenBubbleDisplayed()); 56 ASSERT_TRUE(IsFullscreenBubbleDisplayed());
56 57
(...skipping 13 matching lines...) Expand all
70 ASSERT_TRUE(IsFullscreenBubbleDisplayed()); 71 ASSERT_TRUE(IsFullscreenBubbleDisplayed());
71 72
72 // Close tab. Bubble is cleared. 73 // Close tab. Bubble is cleared.
73 { 74 {
74 MouseLockNotificationObserver mouse_lock_observer; 75 MouseLockNotificationObserver mouse_lock_observer;
75 chrome::CloseTab(browser()); 76 chrome::CloseTab(browser());
76 mouse_lock_observer.Wait(); 77 mouse_lock_observer.Wait();
77 } 78 }
78 ASSERT_FALSE(IsFullscreenBubbleDisplayed()); 79 ASSERT_FALSE(IsFullscreenBubbleDisplayed());
79 } 80 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698