| 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 "content/browser/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 "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace device { |
| 14 | 14 |
| 15 class WakeLockServiceContextTest : public testing::Test { | 15 class WakeLockServiceContextTest : public testing::Test { |
| 16 public: | 16 public: |
| 17 WakeLockServiceContextTest() | 17 WakeLockServiceContextTest() |
| 18 : wake_lock_service_context_( | 18 : wake_lock_service_context_( |
| 19 base::ThreadTaskRunnerHandle::Get(), | 19 base::ThreadTaskRunnerHandle::Get(), |
| 20 base::Bind(&WakeLockServiceContextTest::GetNativeView, | 20 base::Bind(&WakeLockServiceContextTest::GetNativeView, |
| 21 base::Unretained(this))) {} | 21 base::Unretained(this))) {} |
| 22 | 22 |
| 23 protected: | 23 protected: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 53 // Should set the blocker. | 53 // Should set the blocker. |
| 54 EXPECT_TRUE(HasWakeLock()); | 54 EXPECT_TRUE(HasWakeLock()); |
| 55 | 55 |
| 56 // Remove wake lock request. | 56 // Remove wake lock request. |
| 57 CancelWakeLock(); | 57 CancelWakeLock(); |
| 58 | 58 |
| 59 // Should remove the blocker. | 59 // Should remove the blocker. |
| 60 EXPECT_FALSE(HasWakeLock()); | 60 EXPECT_FALSE(HasWakeLock()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace content | 63 } // namespace device |
| OLD | NEW |