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