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

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

Issue 2125263002: Explicitly set a requestor origin when calling into WebLocalFrame::loadRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: blink:: Created 4 years, 5 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/tests/WebFrameTest.cpp ('k') | no next file » | 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 "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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698