| 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 "web/tests/sim/SimTest.h" | 5 #include "web/tests/sim/SimTest.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "platform/LayoutTestSupport.h" | 8 #include "platform/LayoutTestSupport.h" |
| 9 #include "platform/scroll/ScrollbarTheme.h" | 9 #include "platform/scroll/ScrollbarTheme.h" |
| 10 #include "public/platform/WebSecurityOrigin.h" |
| 10 #include "public/web/WebCache.h" | 11 #include "public/web/WebCache.h" |
| 11 #include "web/WebLocalFrameImpl.h" | 12 #include "web/WebLocalFrameImpl.h" |
| 12 #include "web/WebViewImpl.h" | 13 #include "web/WebViewImpl.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 SimTest::SimTest() | 17 SimTest::SimTest() |
| 17 : m_webViewClient(m_compositor) | 18 : m_webViewClient(m_compositor) |
| 18 { | 19 { |
| 19 Document::setThreadedParsingEnabledForTesting(false); | 20 Document::setThreadedParsingEnabledForTesting(false); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 35 LayoutTestSupport::setMockThemeEnabledForTest(false); | 36 LayoutTestSupport::setMockThemeEnabledForTest(false); |
| 36 ScrollbarTheme::setMockScrollbarsEnabled(false); | 37 ScrollbarTheme::setMockScrollbarsEnabled(false); |
| 37 WebCache::clear(); | 38 WebCache::clear(); |
| 38 } | 39 } |
| 39 | 40 |
| 40 void SimTest::loadURL(const String& url) | 41 void SimTest::loadURL(const String& url) |
| 41 { | 42 { |
| 42 WebURLRequest request; | 43 WebURLRequest request; |
| 43 request.initialize(); | 44 request.initialize(); |
| 44 request.setURL(KURL(ParsedURLString, url)); | 45 request.setURL(KURL(ParsedURLString, url)); |
| 46 request.setRequestorOrigin(WebSecurityOrigin::createUnique()); |
| 45 webView().mainFrameImpl()->loadRequest(request); | 47 webView().mainFrameImpl()->loadRequest(request); |
| 46 } | 48 } |
| 47 | 49 |
| 48 Document& SimTest::document() | 50 Document& SimTest::document() |
| 49 { | 51 { |
| 50 return *webView().mainFrameImpl()->frame()->document(); | 52 return *webView().mainFrameImpl()->frame()->document(); |
| 51 } | 53 } |
| 52 | 54 |
| 53 WebViewImpl& SimTest::webView() | 55 WebViewImpl& SimTest::webView() |
| 54 { | 56 { |
| 55 return *m_webViewHelper.webViewImpl(); | 57 return *m_webViewHelper.webViewImpl(); |
| 56 } | 58 } |
| 57 | 59 |
| 58 const SimWebViewClient& SimTest::webViewClient() const | 60 const SimWebViewClient& SimTest::webViewClient() const |
| 59 { | 61 { |
| 60 return m_webViewClient; | 62 return m_webViewClient; |
| 61 } | 63 } |
| 62 | 64 |
| 63 SimCompositor& SimTest::compositor() | 65 SimCompositor& SimTest::compositor() |
| 64 { | 66 { |
| 65 return m_compositor; | 67 return m_compositor; |
| 66 } | 68 } |
| 67 | 69 |
| 68 } // namespace blink | 70 } // namespace blink |
| OLD | NEW |