| 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 "content/browser/memory/memory_coordinator.h" |
| 6 | 6 |
| 7 #include "base/memory/memory_pressure_monitor.h" | 7 #include "base/memory/memory_pressure_monitor.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "components/memory_coordinator/common/memory_coordinator_features.h" | |
| 11 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
| 12 | 11 |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 13 |
| 15 namespace memory_coordinator { | 14 namespace content { |
| 16 | 15 |
| 17 namespace { | 16 namespace { |
| 18 | 17 |
| 19 void RunUntilIdle() { | 18 void RunUntilIdle() { |
| 20 base::RunLoop loop; | 19 base::RunLoop loop; |
| 21 loop.RunUntilIdle(); | 20 loop.RunUntilIdle(); |
| 22 } | 21 } |
| 23 | 22 |
| 24 } // namespace | 23 } // namespace |
| 25 | 24 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 129 |
| 131 EXPECT_TRUE(mc.SetMemoryState(1, mojom::MemoryState::THROTTLED)); | 130 EXPECT_TRUE(mc.SetMemoryState(1, mojom::MemoryState::THROTTLED)); |
| 132 EXPECT_EQ(1, cmc1->on_state_change_calls()); | 131 EXPECT_EQ(1, cmc1->on_state_change_calls()); |
| 133 EXPECT_EQ(mojom::MemoryState::THROTTLED, cmc1->state()); | 132 EXPECT_EQ(mojom::MemoryState::THROTTLED, cmc1->state()); |
| 134 | 133 |
| 135 EXPECT_TRUE(mc.SetMemoryState(2, mojom::MemoryState::SUSPENDED)); | 134 EXPECT_TRUE(mc.SetMemoryState(2, mojom::MemoryState::SUSPENDED)); |
| 136 EXPECT_EQ(1, cmc2->on_state_change_calls()); | 135 EXPECT_EQ(1, cmc2->on_state_change_calls()); |
| 137 EXPECT_EQ(mojom::MemoryState::SUSPENDED, cmc2->state()); | 136 EXPECT_EQ(mojom::MemoryState::SUSPENDED, cmc2->state()); |
| 138 } | 137 } |
| 139 | 138 |
| 140 } // namespace memory_coordinator | 139 } // namespace content |
| OLD | NEW |