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

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: code rebase 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 : 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
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
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