| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "chrome/browser/dock_info.h" | 7 #include "chrome/browser/dock_info.h" |
| 8 #include "chrome/browser/dom_ui/new_tab_ui.h" | 8 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
| 10 #include "chrome/browser/profile_manager.h" | 10 #include "chrome/browser/profile_manager.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // A dummy TabContents we give to callers that expect us to actually build a | 58 // A dummy TabContents we give to callers that expect us to actually build a |
| 59 // Destinations tab for them. | 59 // Destinations tab for them. |
| 60 TabContents* dummy_contents_; | 60 TabContents* dummy_contents_; |
| 61 | 61 |
| 62 DISALLOW_EVIL_CONSTRUCTORS(TabStripDummyDelegate); | 62 DISALLOW_EVIL_CONSTRUCTORS(TabStripDummyDelegate); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 class TabStripModelTest : public RenderViewHostTestHarness { | 65 class TabStripModelTest : public RenderViewHostTestHarness { |
| 66 public: | 66 public: |
| 67 TabContents* CreateTabContents() { | 67 TabContents* CreateTabContents() { |
| 68 WebContents* con = new WebContents(profile(), NULL, &rvh_factory_, 0, NULL); | 68 WebContents* con = new WebContents(profile(), NULL, 0, NULL); |
| 69 con->SetupController(profile()); | 69 con->SetupController(profile()); |
| 70 return con; | 70 return con; |
| 71 } | 71 } |
| 72 | 72 |
| 73 // Forwards a URL "load" request through to our dummy TabContents | 73 // Forwards a URL "load" request through to our dummy TabContents |
| 74 // implementation. | 74 // implementation. |
| 75 void LoadURL(TabContents* con, const std::wstring& url) { | 75 void LoadURL(TabContents* con, const std::wstring& url) { |
| 76 controller()->LoadURL(GURL(url), GURL(), PageTransition::LINK); | 76 controller()->LoadURL(GURL(url), GURL(), PageTransition::LINK); |
| 77 } | 77 } |
| 78 | 78 |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 | 1204 |
| 1205 // Now select the last tab. | 1205 // Now select the last tab. |
| 1206 strip.SelectTabContentsAt(strip.count() - 1, true); | 1206 strip.SelectTabContentsAt(strip.count() - 1, true); |
| 1207 | 1207 |
| 1208 // Now close the last tab. The next adjacent should be selected. | 1208 // Now close the last tab. The next adjacent should be selected. |
| 1209 strip.CloseTabContentsAt(strip.count() - 1); | 1209 strip.CloseTabContentsAt(strip.count() - 1); |
| 1210 EXPECT_EQ(page_d_contents, strip.GetTabContentsAt(strip.selected_index())); | 1210 EXPECT_EQ(page_d_contents, strip.GetTabContentsAt(strip.selected_index())); |
| 1211 | 1211 |
| 1212 strip.CloseAllTabs(); | 1212 strip.CloseAllTabs(); |
| 1213 } | 1213 } |
| OLD | NEW |