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/tabpose_window.h" |
| 6 |
| 7 #include "base/scoped_nsobject.h" |
| 8 #import "chrome/browser/cocoa/browser_test_helper.h" |
| 9 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 |
| 12 class TabposeWindowTest : public CocoaTest { |
| 13 public: |
| 14 BrowserTestHelper browser_helper_; |
| 15 }; |
| 16 |
| 17 // Check that this doesn't leak. |
| 18 TEST_F(TabposeWindowTest, TestShow) { |
| 19 scoped_nsobject<NSWindow> parent([[NSWindow alloc] |
| 20 initWithContentRect:NSMakeRect(100, 200, 300, 200) |
| 21 styleMask:NSTitledWindowMask |
| 22 backing:NSBackingStoreBuffered |
| 23 defer:NO]); |
| 24 [parent orderFront:nil]; |
| 25 EXPECT_TRUE([parent isVisible]); |
| 26 |
| 27 base::ScopedNSAutoreleasePool pool; |
| 28 TabposeWindow* window = |
| 29 [TabposeWindow openTabposeFor:parent.get() |
| 30 rect:NSMakeRect(10, 20, 50, 60) |
| 31 slomo:NO]; |
| 32 |
| 33 // Should release the window. |
| 34 [window mouseDown:nil]; |
| 35 } |
OLD | NEW |