| 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/memory/tab_manager.h" | 5 #include "chrome/browser/memory/tab_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 | 442 |
| 443 WebContents* null_contents = tab_manager.DiscardWebContentsAt(1, &tabstrip); | 443 WebContents* null_contents = tab_manager.DiscardWebContentsAt(1, &tabstrip); |
| 444 EXPECT_EQ(new_last_active_time, null_contents->GetLastActiveTime()); | 444 EXPECT_EQ(new_last_active_time, null_contents->GetLastActiveTime()); |
| 445 | 445 |
| 446 tabstrip.CloseAllTabs(); | 446 tabstrip.CloseAllTabs(); |
| 447 EXPECT_TRUE(tabstrip.empty()); | 447 EXPECT_TRUE(tabstrip.empty()); |
| 448 } | 448 } |
| 449 | 449 |
| 450 // Test to see if a tab can only be discarded once. On Windows and Mac, this | 450 // Test to see if a tab can only be discarded once. On Windows and Mac, this |
| 451 // defaults to true unless overridden through a variation parameter. On other | 451 // defaults to true unless overridden through a variation parameter. On other |
| 452 // platforms, it's always false | 452 // platforms, it's always false. |
| 453 #if defined(OS_WIN) || defined(OS_MACOSX) | 453 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 454 TEST_F(TabManagerTest, CanOnlyDiscardOnce) { | 454 TEST_F(TabManagerTest, CanOnlyDiscardOnce) { |
| 455 TabManager tab_manager; | 455 TabManager tab_manager; |
| 456 const std::string kTrialName = features::kAutomaticTabDiscarding.name; | 456 const std::string kTrialName = features::kAutomaticTabDiscarding.name; |
| 457 | 457 |
| 458 // Not setting the variation parameter. | 458 // Not setting the variation parameter. |
| 459 { | 459 { |
| 460 bool discard_once_value = tab_manager.CanOnlyDiscardOnce(); | 460 bool discard_once_value = tab_manager.CanOnlyDiscardOnce(); |
| 461 EXPECT_TRUE(discard_once_value); | 461 EXPECT_TRUE(discard_once_value); |
| 462 } | 462 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 EXPECT_EQ(0u, task_runner->size()); | 661 EXPECT_EQ(0u, task_runner->size()); |
| 662 EXPECT_EQ(0u, tm.notified_renderers_.size()); | 662 EXPECT_EQ(0u, tm.notified_renderers_.size()); |
| 663 | 663 |
| 664 | 664 |
| 665 // Clean up the tabstrip. | 665 // Clean up the tabstrip. |
| 666 tabstrip.CloseAllTabs(); | 666 tabstrip.CloseAllTabs(); |
| 667 ASSERT_TRUE(tabstrip.empty()); | 667 ASSERT_TRUE(tabstrip.empty()); |
| 668 } | 668 } |
| 669 | 669 |
| 670 } // namespace memory | 670 } // namespace memory |
| OLD | NEW |