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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm

Issue 7740044: Implement fullscreen info bubble on Win and Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix license Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/memory/scoped_nsobject.h" 5 #include "base/memory/scoped_nsobject.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "chrome/browser/bookmarks/bookmark_utils.h" 8 #include "chrome/browser/bookmarks/bookmark_utils.h"
9 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" 9 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h"
10 #include "chrome/browser/ui/cocoa/browser_window_controller.h" 10 #include "chrome/browser/ui/cocoa/browser_window_controller.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 bookmark_utils::ToggleWhenVisible(profile()); 87 bookmark_utils::ToggleWhenVisible(profile());
88 EXPECT_EQ(before, bwc->IsBookmarkBarVisible()); 88 EXPECT_EQ(before, bwc->IsBookmarkBarVisible());
89 } 89 }
90 90
91 @interface FakeController : NSWindowController { 91 @interface FakeController : NSWindowController {
92 BOOL fullscreen_; 92 BOOL fullscreen_;
93 } 93 }
94 @end 94 @end
95 95
96 @implementation FakeController 96 @implementation FakeController
97 - (void)setFullscreen:(BOOL)fullscreen { 97 - (void)setFullscreen:(BOOL)fullscreen
98 url:(const GURL&)url
99 askPermission:(BOOL)askPermission {
98 fullscreen_ = fullscreen; 100 fullscreen_ = fullscreen;
99 } 101 }
100 - (BOOL)isFullscreen { 102 - (BOOL)isFullscreen {
101 return fullscreen_; 103 return fullscreen_;
102 } 104 }
103 @end 105 @end
104 106
105 TEST_F(BrowserWindowCocoaTest, TestFullscreen) { 107 TEST_F(BrowserWindowCocoaTest, TestFullscreen) {
106 // Wrap the FakeController in a scoped_nsobject instead of autoreleasing in 108 // Wrap the FakeController in a scoped_nsobject instead of autoreleasing in
107 // windowWillClose: because we never actually open a window in this test (so 109 // windowWillClose: because we never actually open a window in this test (so
108 // windowWillClose: never gets called). 110 // windowWillClose: never gets called).
109 scoped_nsobject<FakeController> fake_controller( 111 scoped_nsobject<FakeController> fake_controller(
110 [[FakeController alloc] init]); 112 [[FakeController alloc] init]);
111 BrowserWindowCocoaPong* bwc = new BrowserWindowCocoaPong( 113 BrowserWindowCocoaPong* bwc = new BrowserWindowCocoaPong(
112 browser(), 114 browser(),
113 (BrowserWindowController*)fake_controller.get()); 115 (BrowserWindowController*)fake_controller.get());
114 scoped_ptr<BrowserWindowCocoaPong> scoped_bwc(bwc); 116 scoped_ptr<BrowserWindowCocoaPong> scoped_bwc(bwc);
115 117
116 EXPECT_FALSE(bwc->IsFullscreen()); 118 EXPECT_FALSE(bwc->IsFullscreen());
117 bwc->SetFullscreen(true); 119 bwc->EnterFullscreen(GURL(), false);
118 EXPECT_TRUE(bwc->IsFullscreen()); 120 EXPECT_TRUE(bwc->IsFullscreen());
119 bwc->SetFullscreen(false); 121 bwc->ExitFullscreen();
120 EXPECT_FALSE(bwc->IsFullscreen()); 122 EXPECT_FALSE(bwc->IsFullscreen());
121 [fake_controller close]; 123 [fake_controller close];
122 } 124 }
123 125
124 // TODO(???): test other methods of BrowserWindowCocoa 126 // TODO(???): test other methods of BrowserWindowCocoa
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/ui/cocoa/browser_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698