summaryrefslogtreecommitdiffstats
path: root/ui/base/cocoa/fullscreen_window_manager_unittest.mm
blob: eee50974ab717d232b6e8290061e24bbf1edba3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "ui/base/cocoa/fullscreen_window_manager.h"


#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#import "ui/base/test/ui_cocoa_test_helper.h"

typedef ui::CocoaTest FullscreenWindowManagerTest;

TEST_F(FullscreenWindowManagerTest, EnterExit) {
  scoped_nsobject<FullscreenWindowManager> manager(
      [[FullscreenWindowManager alloc]
          initWithWindow:test_window()
           desiredScreen:[NSScreen mainScreen]]);

  SystemUIMode mode = kUIModeNormal;
  GetSystemUIMode(&mode, NULL);
  EXPECT_EQ(kUIModeNormal, mode);

  [manager enterFullscreenMode];
  GetSystemUIMode(&mode, NULL);
  EXPECT_EQ(kUIModeAllHidden, mode);

  [manager exitFullscreenMode];
  GetSystemUIMode(&mode, NULL);
  EXPECT_EQ(kUIModeNormal, mode);
}