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

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

Issue 251903006: Attempt 2 to enable async data: URL loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better fix for BrowserPlugin tests from lazyboy@ Created 6 years, 7 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 | Annotate | Revision Log
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 "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/common/dom_storage/dom_storage_types.h" 8 #include "content/common/dom_storage/dom_storage_types.h"
9 #include "content/common/frame_messages.h" 9 #include "content/common/frame_messages.h"
10 #include "content/common/input_messages.h" 10 #include "content/common/input_messages.h"
11 #include "content/common/view_messages.h" 11 #include "content/common/view_messages.h"
12 #include "content/public/browser/content_browser_client.h" 12 #include "content/public/browser/content_browser_client.h"
13 #include "content/public/browser/native_web_keyboard_event.h" 13 #include "content/public/browser/native_web_keyboard_event.h"
14 #include "content/public/common/content_client.h" 14 #include "content/public/common/content_client.h"
15 #include "content/public/common/renderer_preferences.h" 15 #include "content/public/common/renderer_preferences.h"
16 #include "content/public/renderer/content_renderer_client.h" 16 #include "content/public/renderer/content_renderer_client.h"
17 #include "content/public/test/frame_load_waiter.h"
17 #include "content/renderer/history_controller.h" 18 #include "content/renderer/history_controller.h"
18 #include "content/renderer/history_serialization.h" 19 #include "content/renderer/history_serialization.h"
19 #include "content/renderer/render_thread_impl.h" 20 #include "content/renderer/render_thread_impl.h"
20 #include "content/renderer/render_view_impl.h" 21 #include "content/renderer/render_view_impl.h"
21 #include "content/renderer/renderer_main_platform_delegate.h" 22 #include "content/renderer/renderer_main_platform_delegate.h"
22 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 23 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
23 #include "content/test/mock_render_process.h" 24 #include "content/test/mock_render_process.h"
24 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 25 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
25 #include "third_party/WebKit/public/platform/WebURLRequest.h" 26 #include "third_party/WebKit/public/platform/WebURLRequest.h"
26 #include "third_party/WebKit/public/web/WebHistoryItem.h" 27 #include "third_party/WebKit/public/web/WebHistoryItem.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 if (int_result) 111 if (int_result)
111 *int_result = result->Int32Value(); 112 *int_result = result->Int32Value();
112 113
113 return true; 114 return true;
114 } 115 }
115 116
116 void RenderViewTest::LoadHTML(const char* html) { 117 void RenderViewTest::LoadHTML(const char* html) {
117 std::string url_str = "data:text/html;charset=utf-8,"; 118 std::string url_str = "data:text/html;charset=utf-8,";
118 url_str.append(html); 119 url_str.append(html);
119 GURL url(url_str); 120 GURL url(url_str);
120
121 GetMainFrame()->loadRequest(WebURLRequest(url)); 121 GetMainFrame()->loadRequest(WebURLRequest(url));
122
123 // The load actually happens asynchronously, so we pump messages to process 122 // The load actually happens asynchronously, so we pump messages to process
124 // the pending continuation. 123 // the pending continuation.
125 ProcessPendingMessages(); 124 FrameLoadWaiter(view_).Wait();
126 } 125 }
127 126
128 void RenderViewTest::GoBack(const blink::WebHistoryItem& item) { 127 void RenderViewTest::GoBack(const blink::WebHistoryItem& item) {
129 GoToOffset(-1, item); 128 GoToOffset(-1, item);
130 } 129 }
131 130
132 void RenderViewTest::GoForward(const blink::WebHistoryItem& item) { 131 void RenderViewTest::GoForward(const blink::WebHistoryItem& item) {
133 GoToOffset(1, item); 132 GoToOffset(1, item);
134 } 133 }
135 134
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 FrameMsg_Navigate navigate_message(impl->main_render_frame()->GetRoutingID(), 420 FrameMsg_Navigate navigate_message(impl->main_render_frame()->GetRoutingID(),
422 navigate_params); 421 navigate_params);
423 impl->main_render_frame()->OnMessageReceived(navigate_message); 422 impl->main_render_frame()->OnMessageReceived(navigate_message);
424 423
425 // The load actually happens asynchronously, so we pump messages to process 424 // The load actually happens asynchronously, so we pump messages to process
426 // the pending continuation. 425 // the pending continuation.
427 ProcessPendingMessages(); 426 ProcessPendingMessages();
428 } 427 }
429 428
430 } // namespace content 429 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698