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 "components/memory_coordinator/browser/memory_coordinator.h" | 5 #include "components/memory_coordinator/browser/memory_coordinator.h" |
6 #include "components/memory_coordinator/common/memory_coordinator_features.h" | 6 #include "components/memory_coordinator/common/memory_coordinator_features.h" |
7 #include "content/browser/browser_main_loop.h" | 7 #include "content/browser/browser_main_loop.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 memory_coordinator::EnableForTesting(); | 18 memory_coordinator::EnableForTesting(); |
19 ContentBrowserTest::SetUp(); | 19 ContentBrowserTest::SetUp(); |
20 } | 20 } |
21 | 21 |
22 protected: | 22 protected: |
23 memory_coordinator::MemoryCoordinator* memory_coordinator() { | 23 memory_coordinator::MemoryCoordinator* memory_coordinator() { |
24 return BrowserMainLoop::GetInstance()->memory_coordinator(); | 24 return memory_coordinator::MemoryCoordinator::GetInstance(); |
25 } | 25 } |
26 | 26 |
27 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorTest); | 27 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorTest); |
28 }; | 28 }; |
29 | 29 |
30 IN_PROC_BROWSER_TEST_F(MemoryCoordinatorTest, HandleAdded) { | 30 IN_PROC_BROWSER_TEST_F(MemoryCoordinatorTest, HandleAdded) { |
31 GURL url = GetTestUrl("", "simple_page.html"); | 31 GURL url = GetTestUrl("", "simple_page.html"); |
32 NavigateToURL(shell(), url); | 32 NavigateToURL(shell(), url); |
33 EXPECT_EQ(1u, memory_coordinator()->NumChildrenForTesting()); | 33 EXPECT_EQ(1u, memory_coordinator()->NumChildrenForTesting()); |
34 } | 34 } |
35 | 35 |
36 } // namespace content | 36 } // namespace content |
OLD | NEW |