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

Side by Side Diff: third_party/WebKit/Source/web/tests/FrameTestHelpers.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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 17 matching lines...) Expand all
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "web/tests/FrameTestHelpers.h" 31 #include "web/tests/FrameTestHelpers.h"
32 32
33 #include "platform/testing/URLTestHelpers.h" 33 #include "platform/testing/URLTestHelpers.h"
34 #include "platform/testing/UnitTestHelpers.h" 34 #include "platform/testing/UnitTestHelpers.h"
35 #include "platform/testing/WebLayerTreeViewImplForTesting.h" 35 #include "platform/testing/WebLayerTreeViewImplForTesting.h"
36 #include "public/platform/Platform.h" 36 #include "public/platform/Platform.h"
37 #include "public/platform/WebData.h" 37 #include "public/platform/WebData.h"
38 #include "public/platform/WebSecurityOrigin.h"
38 #include "public/platform/WebString.h" 39 #include "public/platform/WebString.h"
39 #include "public/platform/WebThread.h" 40 #include "public/platform/WebThread.h"
40 #include "public/platform/WebURLLoaderMockFactory.h" 41 #include "public/platform/WebURLLoaderMockFactory.h"
41 #include "public/platform/WebURLRequest.h" 42 #include "public/platform/WebURLRequest.h"
42 #include "public/platform/WebURLResponse.h" 43 #include "public/platform/WebURLResponse.h"
43 #include "public/web/WebFrameWidget.h" 44 #include "public/web/WebFrameWidget.h"
44 #include "public/web/WebRemoteFrame.h" 45 #include "public/web/WebRemoteFrame.h"
45 #include "public/web/WebSettings.h" 46 #include "public/web/WebSettings.h"
46 #include "public/web/WebTreeScopeType.h" 47 #include "public/web/WebTreeScopeType.h"
47 #include "public/web/WebViewClient.h" 48 #include "public/web/WebViewClient.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 return uniqueName.toString(); 118 return uniqueName.toString();
118 } 119 }
119 120
120 } // namespace 121 } // namespace
121 122
122 void loadFrame(WebFrame* frame, const std::string& url) 123 void loadFrame(WebFrame* frame, const std::string& url)
123 { 124 {
124 WebURLRequest urlRequest; 125 WebURLRequest urlRequest;
125 urlRequest.initialize(); 126 urlRequest.initialize();
126 urlRequest.setURL(URLTestHelpers::toKURL(url)); 127 urlRequest.setURL(URLTestHelpers::toKURL(url));
128 urlRequest.setRequestorOrigin(WebSecurityOrigin::createUnique());
127 frame->loadRequest(urlRequest); 129 frame->loadRequest(urlRequest);
128 pumpPendingRequestsForFrameToLoad(frame); 130 pumpPendingRequestsForFrameToLoad(frame);
129 } 131 }
130 132
131 void loadHTMLString(WebFrame* frame, const std::string& html, const WebURL& base URL) 133 void loadHTMLString(WebFrame* frame, const std::string& html, const WebURL& base URL)
132 { 134 {
133 frame->loadHTMLString(WebData(html.data(), html.size()), baseURL); 135 frame->loadHTMLString(WebData(html.data(), html.size()), baseURL);
134 pumpPendingRequestsForFrameToLoad(frame); 136 pumpPendingRequestsForFrameToLoad(frame);
135 } 137 }
136 138
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 return m_testWebViewClient->layerTreeView(); 333 return m_testWebViewClient->layerTreeView();
332 } 334 }
333 335
334 void TestWebViewWidgetClient::scheduleAnimation() 336 void TestWebViewWidgetClient::scheduleAnimation()
335 { 337 {
336 m_testWebViewClient->scheduleAnimation(); 338 m_testWebViewClient->scheduleAnimation();
337 } 339 }
338 340
339 } // namespace FrameTestHelpers 341 } // namespace FrameTestHelpers
340 } // namespace blink 342 } // namespace blink
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.cc ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698