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

Unified Diff: chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm

Issue 533383002: mac, fullscreen: Major refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clone of patch set 4 from https://codereview.chromium.org/523723002/ Created 6 years, 3 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/cocoa/browser_window_cocoa_unittest.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm b/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
index 4bc8732fd7a11dc139ef3de2163a621928589ca6..5f3833711157ea2967050f8387b7a08762716bb0 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm
@@ -50,71 +50,6 @@ TEST_F(BrowserWindowCocoaTest, TestBookmarkBarVisible) {
EXPECT_EQ(before, bwc->IsBookmarkBarVisible());
}
-@interface FakeController : NSWindowController {
- enum { kNormal, kFullscreen, kPresentation } windowState_;
-}
-@end
-
-@implementation FakeController
-- (void)enterFullscreen {
- windowState_ = kFullscreen;
-}
-- (void)exitFullscreen {
- windowState_ = kNormal;
-}
-- (BOOL)isFullscreen {
- return windowState_ != kNormal;
-}
-- (void)enterPresentationModeForURL:(const GURL&)url
- bubbleType:(FullscreenExitBubbleType)bubbleType {
- windowState_ = kPresentation;
-}
-- (void)exitPresentationMode {
- windowState_ = kNormal;
-}
-- (BOOL)inPresentationMode {
- return windowState_ == kPresentation;
-}
-@end
-
-TEST_F(BrowserWindowCocoaTest, TestFullscreen) {
- // Wrap the FakeController in a scoped_nsobject instead of autoreleasing in
- // windowWillClose: because we never actually open a window in this test (so
- // windowWillClose: never gets called).
- base::scoped_nsobject<FakeController> fake_controller(
- [[FakeController alloc] init]);
- scoped_ptr<BrowserWindowCocoa> bwc(new BrowserWindowCocoa(
- browser(), static_cast<BrowserWindowController*>(fake_controller.get())));
-
- EXPECT_FALSE(bwc->IsFullscreen());
- bwc->EnterFullscreen(GURL(), FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION);
- EXPECT_FALSE(bwc->IsFullscreenWithChrome());
- EXPECT_TRUE(bwc->IsFullscreenWithoutChrome());
- bwc->ExitFullscreen();
- EXPECT_FALSE(bwc->IsFullscreen());
- [fake_controller close];
-}
-
-TEST_F(BrowserWindowCocoaTest, TestFullscreenWithChrome) {
- if (!chrome::mac::SupportsSystemFullscreen())
- return;
- // Wrap the FakeController in a scoped_nsobject instead of autoreleasing in
- // windowWillClose: because we never actually open a window in this test (so
- // windowWillClose: never gets called).
- base::scoped_nsobject<FakeController> fake_controller(
- [[FakeController alloc] init]);
- scoped_ptr<BrowserWindowCocoa> bwc(new BrowserWindowCocoa(
- browser(), static_cast<BrowserWindowController*>(fake_controller.get())));
-
- EXPECT_FALSE(bwc->IsFullscreen());
- bwc->EnterFullscreenWithChrome();
- EXPECT_TRUE(bwc->IsFullscreenWithChrome());
- EXPECT_FALSE(bwc->IsFullscreenWithoutChrome());
- bwc->ExitFullscreen();
- EXPECT_FALSE(bwc->IsFullscreen());
- [fake_controller close];
-}
-
// Tests that BrowserWindowCocoa::Close mimics the behavior of
// -[NSWindow performClose:].
class BrowserWindowCocoaCloseTest : public CocoaProfileTest {
« 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