Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / chrome_browser_window_unittest.mm
blobfdd0c175d72b3027a4f9e48bac2c51f1db62b3c5
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.
5 #import <Cocoa/Cocoa.h>
7 #include "base/debug/debugger.h"
8 #include "chrome/app/chrome_command_ids.h"
9 #import "chrome/browser/ui/cocoa/chrome_browser_window.h"
10 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12 #import "testing/gtest_mac.h"
13 #include "testing/platform_test.h"
15 class ChromeBrowserWindowTest : public CocoaTest {
16  public:
17   void SetUp() override {
18     CocoaTest::SetUp();
19     // Create a window.
20     const NSUInteger mask = NSTitledWindowMask | NSClosableWindowMask |
21         NSMiniaturizableWindowMask | NSResizableWindowMask;
22     window_ = [[ChromeBrowserWindow alloc]
23                initWithContentRect:NSMakeRect(0, 0, 800, 600)
24                styleMask:mask
25                backing:NSBackingStoreBuffered
26                defer:NO];
27     if (base::debug::BeingDebugged()) {
28       [window_ orderFront:nil];
29     } else {
30       [window_ orderBack:nil];
31     }
32   }
34   void TearDown() override {
35     [window_ close];
36     CocoaTest::TearDown();
37   }
39   ChromeBrowserWindow* window_;
42 // Baseline test that the window creates, displays, closes, and
43 // releases.
44 TEST_F(ChromeBrowserWindowTest, ShowAndClose) {
45   [window_ display];