OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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 "chrome/browser/cocoa/first_run_bubble_controller.h" |
| 6 |
| 7 #import <Cocoa/Cocoa.h> |
| 8 |
| 9 #include "base/scoped_nsobject.h" |
| 10 #include "chrome/browser/cocoa/browser_test_helper.h" |
| 11 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 |
| 14 namespace { |
| 15 |
| 16 class FirstRunBubbleControllerTest : public CocoaTest { |
| 17 public: |
| 18 BrowserTestHelper helper_; |
| 19 }; |
| 20 |
| 21 // Check that the bubble doesn't crash or leak. |
| 22 TEST_F(FirstRunBubbleControllerTest, Init) { |
| 23 scoped_nsobject<NSWindow> parent([[NSWindow alloc] |
| 24 initWithContentRect:NSMakeRect(0, 0, 800, 600) |
| 25 styleMask:NSBorderlessWindowMask |
| 26 backing:NSBackingStoreBuffered |
| 27 defer:NO]); |
| 28 [parent setReleasedWhenClosed:NO]; |
| 29 if (DebugUtil::BeingDebugged()) |
| 30 [parent.get() orderFront:nil]; |
| 31 else |
| 32 [parent.get() orderBack:nil]; |
| 33 |
| 34 FirstRunBubbleController* controller = [FirstRunBubbleController |
| 35 showForView:[parent.get() contentView] |
| 36 offset:NSMakePoint(300, 300) |
| 37 profile:helper_.profile()]; |
| 38 EXPECT_TRUE(controller != nil); |
| 39 EXPECT_TRUE([[controller window] isVisible]); |
| 40 [parent.get() close]; |
| 41 } |
| 42 |
| 43 } // namespace |
OLD | NEW |