| Index: content/browser/wake_lock/wake_lock_service_context_unittest.cc
|
| diff --git a/content/browser/wake_lock/wake_lock_service_context_unittest.cc b/content/browser/wake_lock/wake_lock_service_context_unittest.cc
|
| deleted file mode 100644
|
| index 6240132303a2afbc7263cbe74f437466a248a38e..0000000000000000000000000000000000000000
|
| --- a/content/browser/wake_lock/wake_lock_service_context_unittest.cc
|
| +++ /dev/null
|
| @@ -1,63 +0,0 @@
|
| -// Copyright 2015 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -#include "content/browser/wake_lock/wake_lock_service_context.h"
|
| -
|
| -#include <memory>
|
| -
|
| -#include "base/message_loop/message_loop.h"
|
| -#include "base/process/kill.h"
|
| -#include "testing/gtest/include/gtest/gtest.h"
|
| -
|
| -namespace content {
|
| -
|
| -class WakeLockServiceContextTest : public testing::Test {
|
| - public:
|
| - WakeLockServiceContextTest()
|
| - : wake_lock_service_context_(
|
| - base::ThreadTaskRunnerHandle::Get(),
|
| - base::Bind(&WakeLockServiceContextTest::GetNativeView,
|
| - base::Unretained(this))) {}
|
| -
|
| - protected:
|
| - void RequestWakeLock() { GetWakeLockServiceContext()->RequestWakeLock(); }
|
| -
|
| - void CancelWakeLock() { GetWakeLockServiceContext()->CancelWakeLock(); }
|
| -
|
| - WakeLockServiceContext* GetWakeLockServiceContext() {
|
| - return &wake_lock_service_context_;
|
| - }
|
| -
|
| - bool HasWakeLock() {
|
| - return GetWakeLockServiceContext()->HasWakeLockForTests();
|
| - }
|
| -
|
| - private:
|
| - gfx::NativeView GetNativeView() { return nullptr; }
|
| -
|
| - base::MessageLoop message_loop_;
|
| - WakeLockServiceContext wake_lock_service_context_;
|
| -};
|
| -
|
| -TEST_F(WakeLockServiceContextTest, NoLockInitially) {
|
| - EXPECT_FALSE(HasWakeLock());
|
| -}
|
| -
|
| -TEST_F(WakeLockServiceContextTest, LockUnlock) {
|
| - ASSERT_TRUE(GetWakeLockServiceContext());
|
| -
|
| - // Request wake lock.
|
| - RequestWakeLock();
|
| -
|
| - // Should set the blocker.
|
| - EXPECT_TRUE(HasWakeLock());
|
| -
|
| - // Remove wake lock request.
|
| - CancelWakeLock();
|
| -
|
| - // Should remove the blocker.
|
| - EXPECT_FALSE(HasWakeLock());
|
| -}
|
| -
|
| -} // namespace content
|
|
|