OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/ui/cocoa/tabpose_window.h" | 5 #import "chrome/browser/ui/cocoa/tabpose_window.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser_tabstrip.h" | 7 #include "chrome/browser/ui/browser_tabstrip.h" |
8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
9 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 9 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 TabContents* tab_contents = chrome::TabContentsFactory( | 28 TabContents* tab_contents = chrome::TabContentsFactory( |
29 profile(), site_instance_, MSG_ROUTING_NONE, NULL); | 29 profile(), site_instance_, MSG_ROUTING_NONE, NULL); |
30 browser()->tab_strip_model()->AppendTabContents( | 30 browser()->tab_strip_model()->AppendTabContents( |
31 tab_contents, /*foreground=*/true); | 31 tab_contents, /*foreground=*/true); |
32 } | 32 } |
33 | 33 |
34 scoped_refptr<SiteInstance> site_instance_; | 34 scoped_refptr<SiteInstance> site_instance_; |
35 }; | 35 }; |
36 | 36 |
37 // Check that this doesn't leak. | 37 // Check that this doesn't leak. |
38 #if defined(MAC_OS_X_VERSION_10_7) | |
Nico
2012/08/20 14:53:11
Hm, this won't work. MAC_OS_X_VERSION_10_7 always
| |
39 // http://code.google.com/p/chromium/issues/detail?id=127845 | |
40 #define MAYBE_TestShow DISABLED_TestShow | |
41 #else | |
42 #define MAYBE_TestShow TestShow | |
43 #endif | |
38 TEST_F(TabposeWindowTest, TestShow) { | 44 TEST_F(TabposeWindowTest, TestShow) { |
39 NSWindow* parent = browser()->window()->GetNativeWindow(); | 45 NSWindow* parent = browser()->window()->GetNativeWindow(); |
40 | 46 |
41 [parent orderFront:nil]; | 47 [parent orderFront:nil]; |
42 EXPECT_TRUE([parent isVisible]); | 48 EXPECT_TRUE([parent isVisible]); |
43 | 49 |
44 // Add a few tabs to the tab strip model. | 50 // Add a few tabs to the tab strip model. |
45 for (int i = 0; i < 3; ++i) | 51 for (int i = 0; i < 3; ++i) |
46 AppendTabToStrip(); | 52 AppendTabToStrip(); |
47 | 53 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 DCHECK_EQ([window selectedIndex], 0); | 112 DCHECK_EQ([window selectedIndex], 0); |
107 | 113 |
108 [window selectTileAtIndexWithoutAnimation:1]; | 114 [window selectTileAtIndexWithoutAnimation:1]; |
109 model->CloseTabContentsAt(0, TabStripModel::CLOSE_NONE); | 115 model->CloseTabContentsAt(0, TabStripModel::CLOSE_NONE); |
110 DCHECK_EQ([window thumbnailLayerCount], 1u); | 116 DCHECK_EQ([window thumbnailLayerCount], 1u); |
111 DCHECK_EQ([window selectedIndex], 0); | 117 DCHECK_EQ([window selectedIndex], 0); |
112 | 118 |
113 // Should release the window. | 119 // Should release the window. |
114 [window mouseDown:nil]; | 120 [window mouseDown:nil]; |
115 } | 121 } |
OLD | NEW |