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 "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" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 if (int_result) | 118 if (int_result) |
119 *int_result = result->Int32Value(); | 119 *int_result = result->Int32Value(); |
120 | 120 |
121 return true; | 121 return true; |
122 } | 122 } |
123 | 123 |
124 void RenderViewTest::LoadHTML(const char* html) { | 124 void RenderViewTest::LoadHTML(const char* html) { |
125 std::string url_str = "data:text/html;charset=utf-8,"; | 125 std::string url_str = "data:text/html;charset=utf-8,"; |
126 url_str.append(html); | 126 url_str.append(html); |
127 GURL url(url_str); | 127 GURL url(url_str); |
128 GetMainFrame()->loadRequest(WebURLRequest(url)); | 128 WebURLRequest request(url); |
129 request.setCheckForBrowserSideNavigation(false); | |
clamy
2015/04/08 14:19:30
This ensure we will not attempt to go to the brows
carlosk
2015/04/08 15:16:42
Acknowledged.
| |
130 GetMainFrame()->loadRequest(request); | |
129 // The load actually happens asynchronously, so we pump messages to process | 131 // The load actually happens asynchronously, so we pump messages to process |
130 // the pending continuation. | 132 // the pending continuation. |
131 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | 133 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); |
132 } | 134 } |
133 | 135 |
134 PageState RenderViewTest::GetCurrentPageState() { | 136 PageState RenderViewTest::GetCurrentPageState() { |
135 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); | 137 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); |
136 return HistoryEntryToPageState(impl->history_controller()->GetCurrentEntry()); | 138 return HistoryEntryToPageState(impl->history_controller()->GetCurrentEntry()); |
137 } | 139 } |
138 | 140 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
455 | 457 |
456 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), | 458 impl->GetMainRenderFrame()->OnNavigate(common_params, StartNavigationParams(), |
457 request_params); | 459 request_params); |
458 | 460 |
459 // The load actually happens asynchronously, so we pump messages to process | 461 // The load actually happens asynchronously, so we pump messages to process |
460 // the pending continuation. | 462 // the pending continuation. |
461 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); | 463 FrameLoadWaiter(view_->GetMainRenderFrame()).Wait(); |
462 } | 464 } |
463 | 465 |
464 } // namespace content | 466 } // namespace content |
OLD | NEW |