| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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/cocoa/tabpose_window.h" | 5 #import "chrome/browser/cocoa/tabpose_window.h" |
| 6 | 6 |
| 7 #import "chrome/browser/browser_window.h" | 7 #import "chrome/browser/browser_window.h" |
| 8 #import "chrome/browser/cocoa/browser_test_helper.h" | 8 #import "chrome/browser/cocoa/browser_test_helper.h" |
| 9 #import "chrome/browser/cocoa/cocoa_test_helper.h" | 9 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
| 10 #include "chrome/browser/renderer_host/site_instance.h" | 10 #include "chrome/browser/renderer_host/site_instance.h" |
| 11 #include "chrome/browser/tab_contents/tab_contents.h" | 11 #include "chrome/browser/tab_contents/tab_contents.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 class TabposeWindowTest : public CocoaTest { | 14 class TabposeWindowTest : public CocoaTest { |
| 15 public: | 15 public: |
| 16 TabposeWindowTest() { | 16 TabposeWindowTest() { |
| 17 site_instance_ = | 17 site_instance_ = |
| 18 SiteInstance::CreateSiteInstance(browser_helper_.profile()); | 18 SiteInstance::CreateSiteInstance(browser_helper_.profile()); |
| 19 } | 19 } |
| 20 | 20 |
| 21 void AppendTabToStrip() { | 21 void AppendTabToStrip() { |
| 22 TabContents* tab_contents = new TabContents( | 22 TabContents* tab_contents = new TabContents( |
| 23 browser_helper_.profile(), site_instance_, MSG_ROUTING_NONE, NULL); | 23 browser_helper_.profile(), site_instance_, MSG_ROUTING_NONE, |
| 24 NULL, NULL); |
| 24 browser_helper_.browser()->tabstrip_model()->AppendTabContents( | 25 browser_helper_.browser()->tabstrip_model()->AppendTabContents( |
| 25 tab_contents, /*foreground=*/true); | 26 tab_contents, /*foreground=*/true); |
| 26 } | 27 } |
| 27 | 28 |
| 28 BrowserTestHelper browser_helper_; | 29 BrowserTestHelper browser_helper_; |
| 29 scoped_refptr<SiteInstance> site_instance_; | 30 scoped_refptr<SiteInstance> site_instance_; |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 // Check that this doesn't leak. | 33 // Check that this doesn't leak. |
| 33 TEST_F(TabposeWindowTest, TestShow) { | 34 TEST_F(TabposeWindowTest, TestShow) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 [window selectTileAtIndexWithoutAnimation:1]; | 108 [window selectTileAtIndexWithoutAnimation:1]; |
| 108 model->CloseTabContentsAt(0, TabStripModel::CLOSE_NONE); | 109 model->CloseTabContentsAt(0, TabStripModel::CLOSE_NONE); |
| 109 DCHECK_EQ([window thumbnailLayerCount], 1u); | 110 DCHECK_EQ([window thumbnailLayerCount], 1u); |
| 110 DCHECK_EQ([window selectedIndex], 0); | 111 DCHECK_EQ([window selectedIndex], 0); |
| 111 | 112 |
| 112 // Should release the window. | 113 // Should release the window. |
| 113 [window mouseDown:nil]; | 114 [window mouseDown:nil]; |
| 114 | 115 |
| 115 browser_helper_.CloseBrowserWindow(); | 116 browser_helper_.CloseBrowserWindow(); |
| 116 } | 117 } |
| OLD | NEW |