| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 blink::Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs
(); | 93 blink::Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs
(); |
| 94 blink::WebCache::clear(); | 94 blink::WebCache::clear(); |
| 95 blink::testing::runPendingTasks(); | 95 blink::testing::runPendingTasks(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void loadFrame() | 98 void loadFrame() |
| 99 { | 99 { |
| 100 blink::FrameTestHelpers::loadFrame( | 100 blink::FrameTestHelpers::loadFrame( |
| 101 m_webViewHelper.webView()->mainFrame(), | 101 m_webViewHelper.webView()->mainFrame(), |
| 102 "http://example.com/foo.html"); | 102 "http://example.com/foo.html"); |
| 103 m_webViewHelper.webViewImpl()->updateAllLifecyclePhases(); | 103 m_webViewHelper.webView()->updateAllLifecyclePhases(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 blink::LocalFrame* frame() | 106 blink::LocalFrame* frame() |
| 107 { | 107 { |
| 108 DCHECK(m_webViewHelper.webViewImpl()); | 108 DCHECK(m_webViewHelper.webView()); |
| 109 DCHECK(m_webViewHelper.webViewImpl()->mainFrameImpl()); | 109 DCHECK(m_webViewHelper.webView()->mainFrameImpl()); |
| 110 return m_webViewHelper.webViewImpl()->mainFrameImpl()->frame(); | 110 return m_webViewHelper.webView()->mainFrameImpl()->frame(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 blink::Screen* screen() | 113 blink::Screen* screen() |
| 114 { | 114 { |
| 115 DCHECK(frame()); | 115 DCHECK(frame()); |
| 116 DCHECK(frame()->localDOMWindow()); | 116 DCHECK(frame()->localDOMWindow()); |
| 117 return frame()->localDOMWindow()->screen(); | 117 return frame()->localDOMWindow()->screen(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool screenKeepAwake() | 120 bool screenKeepAwake() |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 ASSERT_FALSE(clientKeepScreenAwake()); | 217 ASSERT_FALSE(clientKeepScreenAwake()); |
| 218 | 218 |
| 219 setKeepAwake(true); | 219 setKeepAwake(true); |
| 220 loadFrame(); | 220 loadFrame(); |
| 221 | 221 |
| 222 EXPECT_FALSE(screenKeepAwake()); | 222 EXPECT_FALSE(screenKeepAwake()); |
| 223 EXPECT_FALSE(clientKeepScreenAwake()); | 223 EXPECT_FALSE(clientKeepScreenAwake()); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace | 226 } // namespace |
| OLD | NEW |