OLD | NEW |
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 181 |
182 if (int_result) | 182 if (int_result) |
183 *int_result = result->Int32Value(); | 183 *int_result = result->Int32Value(); |
184 | 184 |
185 return true; | 185 return true; |
186 } | 186 } |
187 | 187 |
188 void RenderViewTest::LoadHTML(const char* html) { | 188 void RenderViewTest::LoadHTML(const char* html) { |
189 std::string url_string = "data:text/html;charset=utf-8,"; | 189 std::string url_string = "data:text/html;charset=utf-8,"; |
190 url_string.append(html); | 190 url_string.append(html); |
191 GURL url(url_string); | 191 LoadHTMLWithUrlOverride(html, url_string.c_str()); |
192 WebURLRequest request(url); | |
193 request.SetCheckForBrowserSideNavigation(false); | |
194 GetMainFrame()->LoadRequest(request); | |
195 // The load actually happens asynchronously, so we pump messages to process | |
196 // the pending continuation. | |
197 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | |
198 view_->GetWebView()->UpdateAllLifecyclePhases(); | |
199 } | 192 } |
200 | 193 |
201 void RenderViewTest::LoadHTMLWithUrlOverride(const char* html, | 194 void RenderViewTest::LoadHTMLWithUrlOverride(const char* html, |
202 const char* url_override) { | 195 const char* url_override) { |
203 GetMainFrame()->LoadHTMLString(std::string(html), | 196 GetMainFrame()->LoadHTMLString(std::string(html), |
204 blink::WebURL(GURL(url_override))); | 197 blink::WebURL(GURL(url_override))); |
205 // The load actually happens asynchronously, so we pump messages to process | 198 // The load actually happens asynchronously, so we pump messages to process |
206 // the pending continuation. | 199 // the pending continuation. |
207 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | 200 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); |
208 view_->GetWebView()->UpdateAllLifecyclePhases(); | 201 view_->GetWebView()->UpdateAllLifecyclePhases(); |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); | 661 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); |
669 frame->Navigate(common_params, StartNavigationParams(), request_params); | 662 frame->Navigate(common_params, StartNavigationParams(), request_params); |
670 | 663 |
671 // The load actually happens asynchronously, so we pump messages to process | 664 // The load actually happens asynchronously, so we pump messages to process |
672 // the pending continuation. | 665 // the pending continuation. |
673 FrameLoadWaiter(frame).Wait(); | 666 FrameLoadWaiter(frame).Wait(); |
674 view_->GetWebView()->UpdateAllLifecyclePhases(); | 667 view_->GetWebView()->UpdateAllLifecyclePhases(); |
675 } | 668 } |
676 | 669 |
677 } // namespace content | 670 } // namespace content |
OLD | NEW |