Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(946)

Side by Side Diff: third_party/WebKit/Source/web/tests/ScreenWakeLockTest.cpp

Issue 2843353003: Move ownership of PowerSaveBlocker from WakeLockServiceContext to WakeLockServiceImpl (Closed)
Patch Set: correct some trivial #includes Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 {}
56 void HasWakeLockForTests(
57 const HasWakeLockForTestsCallback& callback) override {}
54 58
55 mojo::Binding<WakeLockService> m_binding; 59 mojo::Binding<WakeLockService> m_binding;
56 MockInterfaceProvider* const m_registry; 60 MockInterfaceProvider* const m_registry;
57 }; 61 };
58 std::unique_ptr<MockWakeLockService> m_mockWakeLockService; 62 std::unique_ptr<MockWakeLockService> m_mockWakeLockService;
59 63
60 bool m_wakeLockStatus; 64 bool m_wakeLockStatus;
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
206 ASSERT_FALSE(clientKeepScreenAwake()); 210 ASSERT_FALSE(clientKeepScreenAwake());
207 211
208 setKeepAwake(true); 212 setKeepAwake(true);
209 loadFrame(); 213 loadFrame();
210 214
211 EXPECT_FALSE(screenKeepAwake()); 215 EXPECT_FALSE(screenKeepAwake());
212 EXPECT_FALSE(clientKeepScreenAwake()); 216 EXPECT_FALSE(clientKeepScreenAwake());
213 } 217 }
214 218
215 } // namespace 219 } // namespace
OLDNEW
« device/wake_lock/wake_lock_service_impl.cc ('K') | « device/wake_lock/wake_lock_service_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698