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

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

Issue 2654933003: platform/testing/{URL|Unit}TestHelpers improvements (Closed)
Patch Set: header changes Created 3 years, 10 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 private: 78 private:
79 MockInterfaceProvider m_interfaceProvider; 79 MockInterfaceProvider m_interfaceProvider;
80 }; 80 };
81 81
82 class ScreenWakeLockTest : public testing::Test { 82 class ScreenWakeLockTest : public testing::Test {
83 protected: 83 protected:
84 void SetUp() override { 84 void SetUp() override {
85 m_webViewHelper.initialize(true, &m_testWebFrameClient); 85 m_webViewHelper.initialize(true, &m_testWebFrameClient);
86 blink::URLTestHelpers::registerMockedURLFromBaseURL( 86 blink::URLTestHelpers::registerMockedURLLoadFromBase(
87 blink::WebString::fromUTF8("http://example.com/"), 87 blink::WebString::fromUTF8("http://example.com/"),
88 blink::testing::webTestDataPath(),
88 blink::WebString::fromUTF8("foo.html")); 89 blink::WebString::fromUTF8("foo.html"));
89 loadFrame(); 90 loadFrame();
90 } 91 }
91 92
92 void TearDown() override { 93 void TearDown() override {
93 blink::Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); 94 blink::Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs();
94 blink::WebCache::clear(); 95 blink::WebCache::clear();
95 blink::testing::runPendingTasks(); 96 blink::testing::runPendingTasks();
96 } 97 }
97 98
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 ASSERT_FALSE(clientKeepScreenAwake()); 206 ASSERT_FALSE(clientKeepScreenAwake());
206 207
207 setKeepAwake(true); 208 setKeepAwake(true);
208 loadFrame(); 209 loadFrame();
209 210
210 EXPECT_FALSE(screenKeepAwake()); 211 EXPECT_FALSE(screenKeepAwake());
211 EXPECT_FALSE(clientKeepScreenAwake()); 212 EXPECT_FALSE(clientKeepScreenAwake());
212 } 213 }
213 214
214 } // namespace 215 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698