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

Side by Side Diff: content/test/test_render_view_host.cc

Issue 1425303002: OOPIF: Stop using HistoryController and refactor UpdateState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit Created 5 years, 1 month 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
« no previous file with comments | « content/test/test_render_frame.h ('k') | testing/buildbot/chromium.fyi.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/test/test_render_view_host.h" 5 #include "content/test/test_render_view_host.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 9 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
10 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 10 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
11 #include "content/browser/loader/resource_dispatcher_host_impl.h" 11 #include "content/browser/loader/resource_dispatcher_host_impl.h"
12 #include "content/browser/site_instance_impl.h" 12 #include "content/browser/site_instance_impl.h"
13 #include "content/common/dom_storage/dom_storage_types.h" 13 #include "content/common/dom_storage/dom_storage_types.h"
14 #include "content/common/frame_messages.h" 14 #include "content/common/frame_messages.h"
15 #include "content/common/site_isolation_policy.h"
15 #include "content/common/view_messages.h" 16 #include "content/common/view_messages.h"
16 #include "content/public/browser/browser_context.h" 17 #include "content/public/browser/browser_context.h"
17 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/navigation_controller.h" 19 #include "content/public/browser/navigation_controller.h"
19 #include "content/public/browser/storage_partition.h" 20 #include "content/public/browser/storage_partition.h"
20 #include "content/public/common/content_client.h" 21 #include "content/public/common/content_client.h"
21 #include "content/public/common/page_state.h" 22 #include "content/public/common/page_state.h"
22 #include "content/public/common/web_preferences.h" 23 #include "content/public/common/web_preferences.h"
23 #include "content/test/test_render_frame_host.h" 24 #include "content/test/test_render_frame_host.h"
24 #include "content/test/test_web_contents.h" 25 #include "content/test/test_web_contents.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 const DropData& drop_data) { 292 const DropData& drop_data) {
292 blink::WebDragOperationsMask drag_operation = blink::WebDragOperationEvery; 293 blink::WebDragOperationsMask drag_operation = blink::WebDragOperationEvery;
293 DragEventSourceInfo event_info; 294 DragEventSourceInfo event_info;
294 OnStartDragging(drop_data, drag_operation, SkBitmap(), gfx::Vector2d(), 295 OnStartDragging(drop_data, drag_operation, SkBitmap(), gfx::Vector2d(),
295 event_info); 296 event_info);
296 } 297 }
297 298
298 void TestRenderViewHost::TestOnUpdateStateWithFile( 299 void TestRenderViewHost::TestOnUpdateStateWithFile(
299 int page_id, 300 int page_id,
300 const base::FilePath& file_path) { 301 const base::FilePath& file_path) {
301 OnUpdateState(page_id, 302 PageState state = PageState::CreateForTesting(GURL("http://www.google.com"),
302 PageState::CreateForTesting(GURL("http://www.google.com"), 303 false, "data", &file_path);
303 false, 304 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) {
304 "data", 305 static_cast<RenderFrameHostImpl*>(GetMainFrame())->OnUpdateState(state);
305 &file_path)); 306 } else {
307 OnUpdateState(page_id, state);
308 }
306 } 309 }
307 310
308 RenderViewHostImplTestHarness::RenderViewHostImplTestHarness() { 311 RenderViewHostImplTestHarness::RenderViewHostImplTestHarness() {
309 std::vector<ui::ScaleFactor> scale_factors; 312 std::vector<ui::ScaleFactor> scale_factors;
310 scale_factors.push_back(ui::SCALE_FACTOR_100P); 313 scale_factors.push_back(ui::SCALE_FACTOR_100P);
311 scoped_set_supported_scale_factors_.reset( 314 scoped_set_supported_scale_factors_.reset(
312 new ui::test::ScopedSetSupportedScaleFactors(scale_factors)); 315 new ui::test::ScopedSetSupportedScaleFactors(scale_factors));
313 } 316 }
314 317
315 RenderViewHostImplTestHarness::~RenderViewHostImplTestHarness() { 318 RenderViewHostImplTestHarness::~RenderViewHostImplTestHarness() {
(...skipping 15 matching lines...) Expand all
331 334
332 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { 335 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() {
333 return contents()->GetMainFrame(); 336 return contents()->GetMainFrame();
334 } 337 }
335 338
336 TestWebContents* RenderViewHostImplTestHarness::contents() { 339 TestWebContents* RenderViewHostImplTestHarness::contents() {
337 return static_cast<TestWebContents*>(web_contents()); 340 return static_cast<TestWebContents*>(web_contents());
338 } 341 }
339 342
340 } // namespace content 343 } // namespace content
OLDNEW
« no previous file with comments | « content/test/test_render_frame.h ('k') | testing/buildbot/chromium.fyi.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698