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

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

Issue 2389743002: Content Modularization Project: Move Wake Lock to //device (Closed)
Patch Set: Eliminate frame reference Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/web/BUILD.gn ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "mojo/public/cpp/bindings/strong_binding.h" 11 #include "mojo/public/cpp/bindings/strong_binding.h"
12 #include "platform/testing/URLTestHelpers.h" 12 #include "platform/testing/URLTestHelpers.h"
13 #include "platform/testing/UnitTestHelpers.h" 13 #include "platform/testing/UnitTestHelpers.h"
14 #include "public/platform/InterfaceProvider.h" 14 #include "public/platform/InterfaceProvider.h"
15 #include "public/platform/Platform.h" 15 #include "public/platform/Platform.h"
16 #include "public/platform/WebPageVisibilityState.h" 16 #include "public/platform/WebPageVisibilityState.h"
17 #include "public/platform/WebURLLoaderMockFactory.h" 17 #include "public/platform/WebURLLoaderMockFactory.h"
18 #include "public/web/WebCache.h" 18 #include "public/web/WebCache.h"
19 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
20 #include "web/WebLocalFrameImpl.h" 20 #include "web/WebLocalFrameImpl.h"
21 #include "web/tests/FrameTestHelpers.h" 21 #include "web/tests/FrameTestHelpers.h"
22 22
23 #include <memory> 23 #include <memory>
24 24
25 namespace { 25 namespace {
26 26
27 using blink::ScreenWakeLock; 27 using blink::ScreenWakeLock;
28 using blink::mojom::blink::WakeLockService; 28 using device::mojom::blink::WakeLockService;
29 using blink::mojom::blink::WakeLockServiceRequest; 29 using device::mojom::blink::WakeLockServiceRequest;
30 30
31 // This class allows binding interface requests to a MockWakeLockService. 31 // This class allows binding interface requests to a MockWakeLockService.
32 class MockInterfaceProvider : public blink::InterfaceProvider { 32 class MockInterfaceProvider : public blink::InterfaceProvider {
33 public: 33 public:
34 MockInterfaceProvider() : m_wakeLockStatus(false) {} 34 MockInterfaceProvider() : m_wakeLockStatus(false) {}
35 ~MockInterfaceProvider() {} 35 ~MockInterfaceProvider() {}
36 36
37 void getInterface(const char* name, mojo::ScopedMessagePipeHandle) override; 37 void getInterface(const char* name, mojo::ScopedMessagePipeHandle) override;
38 38
39 bool wakeLockStatus() const { return m_wakeLockStatus; } 39 bool wakeLockStatus() const { return m_wakeLockStatus; }
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 ASSERT_FALSE(clientKeepScreenAwake()); 205 ASSERT_FALSE(clientKeepScreenAwake());
206 206
207 setKeepAwake(true); 207 setKeepAwake(true);
208 loadFrame(); 208 loadFrame();
209 209
210 EXPECT_FALSE(screenKeepAwake()); 210 EXPECT_FALSE(screenKeepAwake());
211 EXPECT_FALSE(clientKeepScreenAwake()); 211 EXPECT_FALSE(clientKeepScreenAwake());
212 } 212 }
213 213
214 } // namespace 214 } // namespace
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/BUILD.gn ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698