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

Side by Side Diff: content/public/test/render_view_test.cc

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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/test/render_view_test.h" 5 #include "content/public/test/render_view_test.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cctype> 9 #include <cctype>
10 10
(...skipping 20 matching lines...) Expand all
31 #include "content/renderer/history_serialization.h" 31 #include "content/renderer/history_serialization.h"
32 #include "content/renderer/render_thread_impl.h" 32 #include "content/renderer/render_thread_impl.h"
33 #include "content/renderer/render_view_impl.h" 33 #include "content/renderer/render_view_impl.h"
34 #include "content/renderer/renderer_blink_platform_impl.h" 34 #include "content/renderer/renderer_blink_platform_impl.h"
35 #include "content/renderer/renderer_main_platform_delegate.h" 35 #include "content/renderer/renderer_main_platform_delegate.h"
36 #include "content/test/fake_compositor_dependencies.h" 36 #include "content/test/fake_compositor_dependencies.h"
37 #include "content/test/mock_render_process.h" 37 #include "content/test/mock_render_process.h"
38 #include "content/test/test_content_client.h" 38 #include "content/test/test_content_client.h"
39 #include "content/test/test_render_frame.h" 39 #include "content/test/test_render_frame.h"
40 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 40 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
41 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
41 #include "third_party/WebKit/public/platform/WebURLRequest.h" 42 #include "third_party/WebKit/public/platform/WebURLRequest.h"
42 #include "third_party/WebKit/public/web/WebDocument.h" 43 #include "third_party/WebKit/public/web/WebDocument.h"
43 #include "third_party/WebKit/public/web/WebHistoryItem.h" 44 #include "third_party/WebKit/public/web/WebHistoryItem.h"
44 #include "third_party/WebKit/public/web/WebInputElement.h" 45 #include "third_party/WebKit/public/web/WebInputElement.h"
45 #include "third_party/WebKit/public/web/WebInputEvent.h" 46 #include "third_party/WebKit/public/web/WebInputEvent.h"
46 #include "third_party/WebKit/public/web/WebKit.h" 47 #include "third_party/WebKit/public/web/WebKit.h"
47 #include "third_party/WebKit/public/web/WebLocalFrame.h" 48 #include "third_party/WebKit/public/web/WebLocalFrame.h"
48 #include "third_party/WebKit/public/web/WebScriptSource.h" 49 #include "third_party/WebKit/public/web/WebScriptSource.h"
49 #include "third_party/WebKit/public/web/WebView.h" 50 #include "third_party/WebKit/public/web/WebView.h"
50 #include "ui/base/resource/resource_bundle.h" 51 #include "ui/base/resource/resource_bundle.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 *int_result = result->Int32Value(); 180 *int_result = result->Int32Value();
180 181
181 return true; 182 return true;
182 } 183 }
183 184
184 void RenderViewTest::LoadHTML(const char* html) { 185 void RenderViewTest::LoadHTML(const char* html) {
185 std::string url_string = "data:text/html;charset=utf-8,"; 186 std::string url_string = "data:text/html;charset=utf-8,";
186 url_string.append(html); 187 url_string.append(html);
187 GURL url(url_string); 188 GURL url(url_string);
188 WebURLRequest request(url); 189 WebURLRequest request(url);
190 request.setRequestorOrigin(blink::WebSecurityOrigin::createUnique());
189 request.setCheckForBrowserSideNavigation(false); 191 request.setCheckForBrowserSideNavigation(false);
190 GetMainFrame()->loadRequest(request); 192 GetMainFrame()->loadRequest(request);
191 // The load actually happens asynchronously, so we pump messages to process 193 // The load actually happens asynchronously, so we pump messages to process
192 // the pending continuation. 194 // the pending continuation.
193 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); 195 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait();
194 view_->GetWebView()->updateAllLifecyclePhases(); 196 view_->GetWebView()->updateAllLifecyclePhases();
195 } 197 }
196 198
197 void RenderViewTest::LoadHTMLWithUrlOverride(const char* html, 199 void RenderViewTest::LoadHTMLWithUrlOverride(const char* html,
198 const char* url_override) { 200 const char* url_override) {
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 668 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
667 frame->Navigate(common_params, StartNavigationParams(), request_params); 669 frame->Navigate(common_params, StartNavigationParams(), request_params);
668 670
669 // The load actually happens asynchronously, so we pump messages to process 671 // The load actually happens asynchronously, so we pump messages to process
670 // the pending continuation. 672 // the pending continuation.
671 FrameLoadWaiter(frame).Wait(); 673 FrameLoadWaiter(frame).Wait();
672 view_->GetWebView()->updateAllLifecyclePhases(); 674 view_->GetWebView()->updateAllLifecyclePhases();
673 } 675 }
674 676
675 } // namespace content 677 } // namespace content
OLDNEW
« no previous file with comments | « components/printing/renderer/print_web_view_helper.cc ('k') | content/shell/renderer/layout_test/blink_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698