| 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 "base/stl_util-inl.h" |
| 7 #include "chrome/browser/dock_info.h" | 8 #include "chrome/browser/dock_info.h" |
| 8 #include "chrome/browser/dom_ui/new_tab_ui.h" | 9 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 9 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| 10 #include "chrome/browser/profile_manager.h" | 11 #include "chrome/browser/profile_manager.h" |
| 11 #include "chrome/browser/renderer_host/test_render_view_host.h" | 12 #include "chrome/browser/renderer_host/test_render_view_host.h" |
| 12 #include "chrome/browser/tab_contents/navigation_controller.h" | 13 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 13 #include "chrome/browser/tab_contents/navigation_entry.h" | 14 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 14 #include "chrome/browser/tab_contents/tab_contents.h" | 15 #include "chrome/browser/tab_contents/tab_contents.h" |
| 15 #include "chrome/browser/tabs/tab_strip_model.h" | 16 #include "chrome/browser/tabs/tab_strip_model.h" |
| 16 #include "chrome/browser/tabs/tab_strip_model_order_controller.h" | 17 #include "chrome/browser/tabs/tab_strip_model_order_controller.h" |
| 17 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/common/stl_util-inl.h" | |
| 19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 21 | 21 |
| 22 class TabStripDummyDelegate : public TabStripModelDelegate { | 22 class TabStripDummyDelegate : public TabStripModelDelegate { |
| 23 public: | 23 public: |
| 24 explicit TabStripDummyDelegate(TabContents* dummy) | 24 explicit TabStripDummyDelegate(TabContents* dummy) |
| 25 : dummy_contents_(dummy), can_close_(true) {} | 25 : dummy_contents_(dummy), can_close_(true) {} |
| 26 virtual ~TabStripDummyDelegate() {} | 26 virtual ~TabStripDummyDelegate() {} |
| 27 | 27 |
| 28 void set_can_close(bool value) { can_close_ = value; } | 28 void set_can_close(bool value) { can_close_ = value; } |
| (...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 | 1192 |
| 1193 // Now select the last tab. | 1193 // Now select the last tab. |
| 1194 strip.SelectTabContentsAt(strip.count() - 1, true); | 1194 strip.SelectTabContentsAt(strip.count() - 1, true); |
| 1195 | 1195 |
| 1196 // Now close the last tab. The next adjacent should be selected. | 1196 // Now close the last tab. The next adjacent should be selected. |
| 1197 strip.CloseTabContentsAt(strip.count() - 1); | 1197 strip.CloseTabContentsAt(strip.count() - 1); |
| 1198 EXPECT_EQ(page_d_contents, strip.GetTabContentsAt(strip.selected_index())); | 1198 EXPECT_EQ(page_d_contents, strip.GetTabContentsAt(strip.selected_index())); |
| 1199 | 1199 |
| 1200 strip.CloseAllTabs(); | 1200 strip.CloseAllTabs(); |
| 1201 } | 1201 } |
| OLD | NEW |