| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tabs/tab_strip_model.h" | 7 #include "chrome/browser/tabs/tab_strip_model.h" |
| 8 #import "chrome/browser/ui/browser_window.h" | 8 #import "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_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 11 #include "content/browser/site_instance.h" | 11 #include "content/public/browser/site_instance.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 using content::SiteInstance; |
| 15 |
| 14 class TabposeWindowTest : public CocoaProfileTest { | 16 class TabposeWindowTest : public CocoaProfileTest { |
| 15 public: | 17 public: |
| 16 virtual void SetUp() { | 18 virtual void SetUp() { |
| 17 CocoaProfileTest::SetUp(); | 19 CocoaProfileTest::SetUp(); |
| 18 ASSERT_TRUE(profile()); | 20 ASSERT_TRUE(profile()); |
| 19 | 21 |
| 20 site_instance_ = SiteInstance::CreateSiteInstance(profile()); | 22 site_instance_ = SiteInstance::Create(profile()); |
| 21 } | 23 } |
| 22 | 24 |
| 23 void AppendTabToStrip() { | 25 void AppendTabToStrip() { |
| 24 TabContentsWrapper* tab_contents = Browser::TabContentsFactory( | 26 TabContentsWrapper* tab_contents = Browser::TabContentsFactory( |
| 25 profile(), site_instance_, MSG_ROUTING_NONE, | 27 profile(), site_instance_, MSG_ROUTING_NONE, |
| 26 NULL, NULL); | 28 NULL, NULL); |
| 27 browser()->tabstrip_model()->AppendTabContents( | 29 browser()->tabstrip_model()->AppendTabContents( |
| 28 tab_contents, /*foreground=*/true); | 30 tab_contents, /*foreground=*/true); |
| 29 } | 31 } |
| 30 | 32 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 DCHECK_EQ([window selectedIndex], 0); | 107 DCHECK_EQ([window selectedIndex], 0); |
| 106 | 108 |
| 107 [window selectTileAtIndexWithoutAnimation:1]; | 109 [window selectTileAtIndexWithoutAnimation:1]; |
| 108 model->CloseTabContentsAt(0, TabStripModel::CLOSE_NONE); | 110 model->CloseTabContentsAt(0, TabStripModel::CLOSE_NONE); |
| 109 DCHECK_EQ([window thumbnailLayerCount], 1u); | 111 DCHECK_EQ([window thumbnailLayerCount], 1u); |
| 110 DCHECK_EQ([window selectedIndex], 0); | 112 DCHECK_EQ([window selectedIndex], 0); |
| 111 | 113 |
| 112 // Should release the window. | 114 // Should release the window. |
| 113 [window mouseDown:nil]; | 115 [window mouseDown:nil]; |
| 114 } | 116 } |
| OLD | NEW |