| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/memory/memory_coordinator.h" | 5 #include "content/browser/memory/memory_coordinator.h" |
| 6 #include "content/browser/browser_main_loop.h" | 6 #include "content/browser/browser_main_loop.h" |
| 7 #include "content/public/common/content_features.h" | 7 #include "content/public/common/content_features.h" |
| 8 #include "content/public/test/content_browser_test.h" | 8 #include "content/public/test/content_browser_test.h" |
| 9 #include "content/public/test/content_browser_test_utils.h" | 9 #include "content/public/test/content_browser_test_utils.h" |
| 10 #include "content/public/test/memory_coordinator_test_utils.h" |
| 10 | 11 |
| 11 namespace content { | 12 namespace content { |
| 12 | 13 |
| 13 class MemoryCoordinatorTest : public ContentBrowserTest { | 14 class MemoryCoordinatorTest : public ContentBrowserTest { |
| 14 public: | 15 public: |
| 15 MemoryCoordinatorTest() {} | 16 MemoryCoordinatorTest() {} |
| 16 | 17 |
| 17 void SetUp() override { | 18 void SetUp() override { |
| 18 MemoryCoordinator::EnableFeaturesForTesting(); | 19 content::EnableFeaturesForTesting(); |
| 19 ContentBrowserTest::SetUp(); | 20 ContentBrowserTest::SetUp(); |
| 20 } | 21 } |
| 21 | 22 |
| 22 private: | 23 private: |
| 23 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorTest); | 24 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorTest); |
| 24 }; | 25 }; |
| 25 | 26 |
| 26 // TODO(bashi): Enable this test on macos when MemoryMonitorMac is implemented. | 27 // TODO(bashi): Enable this test on macos when MemoryMonitorMac is implemented. |
| 27 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
| 28 #define MAYBE_HandleAdded DISABLED_HandleAdded | 29 #define MAYBE_HandleAdded DISABLED_HandleAdded |
| 29 #else | 30 #else |
| 30 #define MAYBE_HandleAdded HandleAdded | 31 #define MAYBE_HandleAdded HandleAdded |
| 31 #endif | 32 #endif |
| 32 IN_PROC_BROWSER_TEST_F(MemoryCoordinatorTest, MAYBE_HandleAdded) { | 33 IN_PROC_BROWSER_TEST_F(MemoryCoordinatorTest, MAYBE_HandleAdded) { |
| 33 GURL url = GetTestUrl("", "simple_page.html"); | 34 GURL url = GetTestUrl("", "simple_page.html"); |
| 34 NavigateToURL(shell(), url); | 35 NavigateToURL(shell(), url); |
| 35 EXPECT_EQ(1u, MemoryCoordinator::GetInstance()->NumChildrenForTesting()); | 36 EXPECT_EQ(1u, MemoryCoordinator::GetInstance()->NumChildrenForTesting()); |
| 36 } | 37 } |
| 37 | 38 |
| 38 } // namespace content | 39 } // namespace content |
| OLD | NEW |