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 : m_binding(this, std::move(request)), m_registry(registry) {} | 47 : m_binding(this, std::move(request)), m_registry(registry) {} |
48 ~MockWakeLockService() {} | 48 ~MockWakeLockService() {} |
49 | 49 |
50 private: | 50 private: |
51 // mojom::WakeLockService | 51 // mojom::WakeLockService |
52 void RequestWakeLock() override { m_registry->setWakeLockStatus(true); } | 52 void RequestWakeLock() override { m_registry->setWakeLockStatus(true); } |
53 void CancelWakeLock() override { m_registry->setWakeLockStatus(false); } | 53 void CancelWakeLock() override { m_registry->setWakeLockStatus(false); } |
| 54 void AddClient( |
| 55 device::mojom::blink::WakeLockServiceRequest wake_lock) override {} |
54 | 56 |
55 mojo::Binding<WakeLockService> m_binding; | 57 mojo::Binding<WakeLockService> m_binding; |
56 MockInterfaceProvider* const m_registry; | 58 MockInterfaceProvider* const m_registry; |
57 }; | 59 }; |
58 std::unique_ptr<MockWakeLockService> m_mockWakeLockService; | 60 std::unique_ptr<MockWakeLockService> m_mockWakeLockService; |
59 | 61 |
60 bool m_wakeLockStatus; | 62 bool m_wakeLockStatus; |
61 }; | 63 }; |
62 | 64 |
63 void MockInterfaceProvider::GetInterface(const char* name, | 65 void MockInterfaceProvider::GetInterface(const char* name, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 ASSERT_FALSE(clientKeepScreenAwake()); | 208 ASSERT_FALSE(clientKeepScreenAwake()); |
207 | 209 |
208 setKeepAwake(true); | 210 setKeepAwake(true); |
209 loadFrame(); | 211 loadFrame(); |
210 | 212 |
211 EXPECT_FALSE(screenKeepAwake()); | 213 EXPECT_FALSE(screenKeepAwake()); |
212 EXPECT_FALSE(clientKeepScreenAwake()); | 214 EXPECT_FALSE(clientKeepScreenAwake()); |
213 } | 215 } |
214 | 216 |
215 } // namespace | 217 } // namespace |
OLD | NEW |