Chromium Code Reviews| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 444 | 444 |
| 445 // Function that simply parrots back an externally specified memory pressure | 445 // Function that simply parrots back an externally specified memory pressure |
| 446 // level. | 446 // level. |
| 447 MemoryPressureLevel ReturnSpecifiedPressure( | 447 MemoryPressureLevel ReturnSpecifiedPressure( |
| 448 const MemoryPressureLevel* level) { | 448 const MemoryPressureLevel* level) { |
| 449 return *level; | 449 return *level; |
| 450 } | 450 } |
| 451 | 451 |
| 452 } // namespace | 452 } // namespace |
| 453 | 453 |
| 454 // ChildProcessNotification is disabled on ChromOS. crbug.com/588172. | |
|
sky
2016/04/04 23:51:37
nit: ChromeOS
oshima
2016/04/05 00:03:50
Done.
| |
| 455 #if !defined(OS_CHROMEOS) | |
| 456 #define MAYBE_ChildProcessNotifications DISABLED_ChildProcessNotifications | |
| 457 #else | |
| 458 #define MAYBE_ChildProcessNotifications ChildProcessNotifications | |
| 459 #endif | |
| 460 | |
| 454 // Ensure that memory pressure notifications are forwarded to child processes. | 461 // Ensure that memory pressure notifications are forwarded to child processes. |
| 455 TEST_F(TabManagerTest, ChildProcessNotifications) { | 462 TEST_F(TabManagerTest, MAYBE_ChildProcessNotifications) { |
| 456 TabManager tm; | 463 TabManager tm; |
| 457 | 464 |
| 458 // Set up the tab strip. | 465 // Set up the tab strip. |
| 459 TabStripDummyDelegate delegate; | 466 TabStripDummyDelegate delegate; |
| 460 TabStripModel tabstrip(&delegate, profile()); | 467 TabStripModel tabstrip(&delegate, profile()); |
| 461 | 468 |
| 462 // Create test clock, task runner. | 469 // Create test clock, task runner. |
| 463 base::SimpleTestTickClock test_clock; | 470 base::SimpleTestTickClock test_clock; |
| 464 MockTaskRunner mock_task_runner; | 471 MockTaskRunner mock_task_runner; |
| 465 scoped_refptr<TaskRunnerProxy> task_runner( | 472 scoped_refptr<TaskRunnerProxy> task_runner( |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 585 EXPECT_EQ(0u, task_runner->size()); | 592 EXPECT_EQ(0u, task_runner->size()); |
| 586 EXPECT_EQ(0u, tm.notified_renderers_.size()); | 593 EXPECT_EQ(0u, tm.notified_renderers_.size()); |
| 587 | 594 |
| 588 | 595 |
| 589 // Clean up the tabstrip. | 596 // Clean up the tabstrip. |
| 590 tabstrip.CloseAllTabs(); | 597 tabstrip.CloseAllTabs(); |
| 591 ASSERT_TRUE(tabstrip.empty()); | 598 ASSERT_TRUE(tabstrip.empty()); |
| 592 } | 599 } |
| 593 | 600 |
| 594 } // namespace memory | 601 } // namespace memory |
| OLD | NEW |