Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: chrome/browser/cocoa/tabpose_window_unittest.mm

Issue 2819070: Mac: Add tabpose window (Closed)
Patch Set: mac compile?! Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/tabpose_window_unittest.mm
diff --git a/chrome/browser/cocoa/tabpose_window_unittest.mm b/chrome/browser/cocoa/tabpose_window_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..8f6f239cd1c5cf0d558e025da863bd0aa0e8db5e
--- /dev/null
+++ b/chrome/browser/cocoa/tabpose_window_unittest.mm
@@ -0,0 +1,35 @@
+// Copyright (c) 2010 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 "chrome/browser/cocoa/tabpose_window.h"
+
+#include "base/scoped_nsobject.h"
+#import "chrome/browser/cocoa/browser_test_helper.h"
+#import "chrome/browser/cocoa/cocoa_test_helper.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+class TabposeWindowTest : public CocoaTest {
+ public:
+ BrowserTestHelper browser_helper_;
+};
+
+// Check that this doesn't leak.
+TEST_F(TabposeWindowTest, TestShow) {
+ scoped_nsobject<NSWindow> parent([[NSWindow alloc]
+ initWithContentRect:NSMakeRect(100, 200, 300, 200)
+ styleMask:NSTitledWindowMask
+ backing:NSBackingStoreBuffered
+ defer:NO]);
+ [parent orderFront:nil];
+ EXPECT_TRUE([parent isVisible]);
+
+ base::ScopedNSAutoreleasePool pool;
+ TabposeWindow* window =
+ [TabposeWindow openTabposeFor:parent.get()
+ rect:NSMakeRect(10, 20, 50, 60)
+ slomo:NO];
+
+ // Should release the window.
+ [window mouseDown:nil];
+}

Powered by Google App Engine
This is Rietveld 408576698