| 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 "modules/wake_lock/ScreenWakeLock.h" | 5 #include "modules/wake_lock/ScreenWakeLock.h" |
| 6 | 6 |
| 7 #include "core/dom/DOMImplementation.h" | 7 #include "core/dom/DOMImplementation.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/DocumentInit.h" | 9 #include "core/dom/DocumentInit.h" |
| 10 #include "mojo/public/cpp/bindings/interface_request.h" | 10 #include "mojo/public/cpp/bindings/interface_request.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 public: | 44 public: |
| 45 MockWakeLockService(MockInterfaceProvider* registry, | 45 MockWakeLockService(MockInterfaceProvider* registry, |
| 46 WakeLockServiceRequest request) | 46 WakeLockServiceRequest request) |
| 47 : binding_(this, std::move(request)), registry_(registry) {} | 47 : binding_(this, std::move(request)), registry_(registry) {} |
| 48 ~MockWakeLockService() {} | 48 ~MockWakeLockService() {} |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // mojom::WakeLockService | 51 // mojom::WakeLockService |
| 52 void RequestWakeLock() override { registry_->SetWakeLockStatus(true); } | 52 void RequestWakeLock() override { registry_->SetWakeLockStatus(true); } |
| 53 void CancelWakeLock() override { registry_->SetWakeLockStatus(false); } | 53 void CancelWakeLock() override { registry_->SetWakeLockStatus(false); } |
| 54 void AddClient( |
| 55 device::mojom::blink::WakeLockServiceRequest wake_lock) override {} |
| 56 void HasWakeLockForTests( |
| 57 const HasWakeLockForTestsCallback& callback) override {} |
| 54 | 58 |
| 55 mojo::Binding<WakeLockService> binding_; | 59 mojo::Binding<WakeLockService> binding_; |
| 56 MockInterfaceProvider* const registry_; | 60 MockInterfaceProvider* const registry_; |
| 57 }; | 61 }; |
| 58 std::unique_ptr<MockWakeLockService> mock_wake_lock_service_; | 62 std::unique_ptr<MockWakeLockService> mock_wake_lock_service_; |
| 59 | 63 |
| 60 bool wake_lock_status_; | 64 bool wake_lock_status_; |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 void MockInterfaceProvider::GetInterface(const char* name, | 67 void MockInterfaceProvider::GetInterface(const char* name, |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 210 |
| 207 SetKeepAwake(true); | 211 SetKeepAwake(true); |
| 208 LoadFrame(); | 212 LoadFrame(); |
| 209 | 213 |
| 210 EXPECT_FALSE(ScreenKeepAwake()); | 214 EXPECT_FALSE(ScreenKeepAwake()); |
| 211 EXPECT_FALSE(ClientKeepScreenAwake()); | 215 EXPECT_FALSE(ClientKeepScreenAwake()); |
| 212 } | 216 } |
| 213 | 217 |
| 214 } // namespace | 218 } // namespace |
| 215 } // namespace blink | 219 } // namespace blink |
| OLD | NEW |