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