| 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 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 5 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 2291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2302 | 2302 |
| 2303 // With pinned tabs. | 2303 // With pinned tabs. |
| 2304 { 6, 2, "2 3", 2, "0p 1p 2 3 4 5" }, | 2304 { 6, 2, "2 3", 2, "0p 1p 2 3 4 5" }, |
| 2305 { 6, 2, "0 4", 3, "1p 0p 2 3 4 5" }, | 2305 { 6, 2, "0 4", 3, "1p 0p 2 3 4 5" }, |
| 2306 { 6, 3, "1 2 4", 0, "1p 2p 0p 4 3 5" }, | 2306 { 6, 3, "1 2 4", 0, "1p 2p 0p 4 3 5" }, |
| 2307 { 8, 3, "1 3 4", 4, "0p 2p 1p 5 6 3 4 7" }, | 2307 { 8, 3, "1 3 4", 4, "0p 2p 1p 5 6 3 4 7" }, |
| 2308 | 2308 |
| 2309 { 7, 4, "2 3 4", 3, "0p 1p 2p 3p 5 4 6" }, | 2309 { 7, 4, "2 3 4", 3, "0p 1p 2p 3p 5 4 6" }, |
| 2310 }; | 2310 }; |
| 2311 | 2311 |
| 2312 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_data); ++i) { | 2312 for (size_t i = 0; i < arraysize(test_data); ++i) { |
| 2313 TabStripDummyDelegate delegate; | 2313 TabStripDummyDelegate delegate; |
| 2314 TabStripModel strip(&delegate, profile()); | 2314 TabStripModel strip(&delegate, profile()); |
| 2315 ASSERT_NO_FATAL_FAILURE( | 2315 ASSERT_NO_FATAL_FAILURE( |
| 2316 PrepareTabstripForSelectionTest(&strip, test_data[i].tab_count, | 2316 PrepareTabstripForSelectionTest(&strip, test_data[i].tab_count, |
| 2317 test_data[i].pinned_count, | 2317 test_data[i].pinned_count, |
| 2318 test_data[i].selected_tabs)); | 2318 test_data[i].selected_tabs)); |
| 2319 strip.MoveSelectedTabsTo(test_data[i].target_index); | 2319 strip.MoveSelectedTabsTo(test_data[i].target_index); |
| 2320 EXPECT_EQ(test_data[i].state_after_move, | 2320 EXPECT_EQ(test_data[i].state_after_move, |
| 2321 GetTabStripStateString(strip)) << i; | 2321 GetTabStripStateString(strip)) << i; |
| 2322 strip.CloseAllTabs(); | 2322 strip.CloseAllTabs(); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2584 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); | 2584 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); |
| 2585 EXPECT_EQ(contents2, moved_contents); | 2585 EXPECT_EQ(contents2, moved_contents); |
| 2586 | 2586 |
| 2587 // Attach the tab to the destination tab strip. | 2587 // Attach the tab to the destination tab strip. |
| 2588 strip_dst.AppendWebContents(moved_contents, true); | 2588 strip_dst.AppendWebContents(moved_contents, true); |
| 2589 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); | 2589 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); |
| 2590 | 2590 |
| 2591 strip_dst.CloseAllTabs(); | 2591 strip_dst.CloseAllTabs(); |
| 2592 strip_src.CloseAllTabs(); | 2592 strip_src.CloseAllTabs(); |
| 2593 } | 2593 } |
| OLD | NEW |