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 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 // Now select the last tab. | 1702 // Now select the last tab. |
1703 strip.ActivateTabAt(strip.count() - 1, true); | 1703 strip.ActivateTabAt(strip.count() - 1, true); |
1704 | 1704 |
1705 // Now close the last tab. The next adjacent should be selected. | 1705 // Now close the last tab. The next adjacent should be selected. |
1706 strip.CloseWebContentsAt(strip.count() - 1, TabStripModel::CLOSE_NONE); | 1706 strip.CloseWebContentsAt(strip.count() - 1, TabStripModel::CLOSE_NONE); |
1707 EXPECT_EQ(page_d_contents, strip.GetWebContentsAt(strip.active_index())); | 1707 EXPECT_EQ(page_d_contents, strip.GetWebContentsAt(strip.active_index())); |
1708 | 1708 |
1709 strip.CloseAllTabs(); | 1709 strip.CloseAllTabs(); |
1710 } | 1710 } |
1711 | 1711 |
| 1712 // This fails on linux when run with the rest of unit_tests (crbug.com/302156). |
| 1713 #if defined(OS_LINUX) |
| 1714 #define MAYBE_FastShutdown \ |
| 1715 DISABLED_FastShutdown |
| 1716 #else |
| 1717 #define MAYBE_FastShutdown \ |
| 1718 FastShutdown |
| 1719 #endif |
1712 // Tests that fast shutdown is attempted appropriately. | 1720 // Tests that fast shutdown is attempted appropriately. |
1713 TEST_F(TabStripModelTest, FastShutdown) { | 1721 TEST_F(TabStripModelTest, MAYBE_FastShutdown) { |
1714 TabStripDummyDelegate delegate; | 1722 TabStripDummyDelegate delegate; |
1715 TabStripModel tabstrip(&delegate, profile()); | 1723 TabStripModel tabstrip(&delegate, profile()); |
1716 MockTabStripModelObserver observer(&tabstrip); | 1724 MockTabStripModelObserver observer(&tabstrip); |
1717 tabstrip.AddObserver(&observer); | 1725 tabstrip.AddObserver(&observer); |
1718 | 1726 |
1719 EXPECT_TRUE(tabstrip.empty()); | 1727 EXPECT_TRUE(tabstrip.empty()); |
1720 | 1728 |
1721 // Make sure fast shutdown is attempted when tabs that share a RPH are shut | 1729 // Make sure fast shutdown is attempted when tabs that share a RPH are shut |
1722 // down. | 1730 // down. |
1723 { | 1731 { |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2473 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); | 2481 WebContents* moved_contents = strip_src.DetachWebContentsAt(1); |
2474 EXPECT_EQ(contents2, moved_contents); | 2482 EXPECT_EQ(contents2, moved_contents); |
2475 | 2483 |
2476 // Attach the tab to the destination tab strip. | 2484 // Attach the tab to the destination tab strip. |
2477 strip_dst.AppendWebContents(moved_contents, true); | 2485 strip_dst.AppendWebContents(moved_contents, true); |
2478 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); | 2486 EXPECT_TRUE(strip_dst.IsTabBlocked(0)); |
2479 | 2487 |
2480 strip_dst.CloseAllTabs(); | 2488 strip_dst.CloseAllTabs(); |
2481 strip_src.CloseAllTabs(); | 2489 strip_src.CloseAllTabs(); |
2482 } | 2490 } |
OLD | NEW |