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

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

Issue 1064413003: PlzNavigate: make RenderViewtest helper functions work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698