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