OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "device/wake_lock/wake_lock_service_context.h" | 5 #include "device/wake_lock/wake_lock_service_context.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/process/kill.h" | 10 #include "base/process/kill.h" |
| 11 #include "base/threading/thread_task_runner_handle.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 namespace device { | 14 namespace device { |
14 | 15 |
15 class WakeLockServiceContextTest : public testing::Test { | 16 class WakeLockServiceContextTest : public testing::Test { |
16 public: | 17 public: |
17 WakeLockServiceContextTest() | 18 WakeLockServiceContextTest() |
18 : wake_lock_service_context_( | 19 : wake_lock_service_context_( |
19 base::ThreadTaskRunnerHandle::Get(), | 20 base::ThreadTaskRunnerHandle::Get(), |
20 base::Bind(&WakeLockServiceContextTest::GetNativeView, | 21 base::Bind(&WakeLockServiceContextTest::GetNativeView, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 EXPECT_TRUE(HasWakeLock()); | 55 EXPECT_TRUE(HasWakeLock()); |
55 | 56 |
56 // Remove wake lock request. | 57 // Remove wake lock request. |
57 CancelWakeLock(); | 58 CancelWakeLock(); |
58 | 59 |
59 // Should remove the blocker. | 60 // Should remove the blocker. |
60 EXPECT_FALSE(HasWakeLock()); | 61 EXPECT_FALSE(HasWakeLock()); |
61 } | 62 } |
62 | 63 |
63 } // namespace device | 64 } // namespace device |
OLD | NEW |