| OLD | NEW |
| 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 #import "ui/base/cocoa/fullscreen_window_manager.h" | 5 #import "ui/base/cocoa/fullscreen_window_manager.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "testing/platform_test.h" | 8 #include "testing/platform_test.h" |
| 9 #import "ui/base/test/ui_cocoa_test_helper.h" | 9 #import "ui/base/test/ui_cocoa_test_helper.h" |
| 10 | 10 |
| 11 typedef ui::CocoaTest FullscreenWindowManagerTest; | 11 typedef ui::CocoaTest FullscreenWindowManagerTest; |
| 12 | 12 |
| 13 TEST_F(FullscreenWindowManagerTest, EnterExit) { | 13 TEST_F(FullscreenWindowManagerTest, EnterExit) { |
| 14 scoped_nsobject<FullscreenWindowManager> manager( | 14 base::scoped_nsobject<FullscreenWindowManager> manager( |
| 15 [[FullscreenWindowManager alloc] | 15 [[FullscreenWindowManager alloc] initWithWindow:test_window() |
| 16 initWithWindow:test_window() | 16 desiredScreen:[NSScreen mainScreen]]); |
| 17 desiredScreen:[NSScreen mainScreen]]); | |
| 18 | 17 |
| 19 NSApplicationPresentationOptions current_options = | 18 NSApplicationPresentationOptions current_options = |
| 20 [NSApp presentationOptions]; | 19 [NSApp presentationOptions]; |
| 21 EXPECT_EQ(NSApplicationPresentationDefault, current_options); | 20 EXPECT_EQ(NSApplicationPresentationDefault, current_options); |
| 22 | 21 |
| 23 [manager enterFullscreenMode]; | 22 [manager enterFullscreenMode]; |
| 24 current_options = [NSApp presentationOptions]; | 23 current_options = [NSApp presentationOptions]; |
| 25 EXPECT_EQ(static_cast<NSApplicationPresentationOptions>( | 24 EXPECT_EQ(static_cast<NSApplicationPresentationOptions>( |
| 26 NSApplicationPresentationHideDock | | 25 NSApplicationPresentationHideDock | |
| 27 NSApplicationPresentationHideMenuBar), | 26 NSApplicationPresentationHideMenuBar), |
| 28 current_options); | 27 current_options); |
| 29 | 28 |
| 30 [manager exitFullscreenMode]; | 29 [manager exitFullscreenMode]; |
| 31 current_options = [NSApp presentationOptions]; | 30 current_options = [NSApp presentationOptions]; |
| 32 EXPECT_EQ(NSApplicationPresentationDefault, current_options); | 31 EXPECT_EQ(NSApplicationPresentationDefault, current_options); |
| 33 } | 32 } |
| OLD | NEW |