| 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/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" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 const DropData& drop_data) { | 288 const DropData& drop_data) { |
| 289 blink::WebDragOperationsMask drag_operation = blink::WebDragOperationEvery; | 289 blink::WebDragOperationsMask drag_operation = blink::WebDragOperationEvery; |
| 290 DragEventSourceInfo event_info; | 290 DragEventSourceInfo event_info; |
| 291 OnStartDragging(drop_data, drag_operation, SkBitmap(), gfx::Vector2d(), | 291 OnStartDragging(drop_data, drag_operation, SkBitmap(), gfx::Vector2d(), |
| 292 event_info); | 292 event_info); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void TestRenderViewHost::TestOnUpdateStateWithFile( | 295 void TestRenderViewHost::TestOnUpdateStateWithFile( |
| 296 int page_id, | 296 int page_id, |
| 297 const base::FilePath& file_path) { | 297 const base::FilePath& file_path) { |
| 298 PageState state = PageState::CreateForTesting(GURL("http://www.google.com"), | |
| 299 false, "data", &file_path); | |
| 300 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { | 298 if (SiteIsolationPolicy::UseSubframeNavigationEntries()) { |
| 299 ExplodedFrameState state; |
| 300 // TODO(creis): Add a CreateForTesting for ExplodedFrameState and fill in |
| 301 // the other parameters. |
| 301 static_cast<RenderFrameHostImpl*>(GetMainFrame())->OnUpdateState(state); | 302 static_cast<RenderFrameHostImpl*>(GetMainFrame())->OnUpdateState(state); |
| 302 } else { | 303 } else { |
| 304 PageState state = PageState::CreateForTesting(GURL("http://www.google.com"), |
| 305 false, "data", &file_path); |
| 303 OnUpdateState(page_id, state); | 306 OnUpdateState(page_id, state); |
| 304 } | 307 } |
| 305 } | 308 } |
| 306 | 309 |
| 307 RenderViewHostImplTestHarness::RenderViewHostImplTestHarness() { | 310 RenderViewHostImplTestHarness::RenderViewHostImplTestHarness() { |
| 308 std::vector<ui::ScaleFactor> scale_factors; | 311 std::vector<ui::ScaleFactor> scale_factors; |
| 309 scale_factors.push_back(ui::SCALE_FACTOR_100P); | 312 scale_factors.push_back(ui::SCALE_FACTOR_100P); |
| 310 scoped_set_supported_scale_factors_.reset( | 313 scoped_set_supported_scale_factors_.reset( |
| 311 new ui::test::ScopedSetSupportedScaleFactors(scale_factors)); | 314 new ui::test::ScopedSetSupportedScaleFactors(scale_factors)); |
| 312 } | 315 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 330 | 333 |
| 331 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { | 334 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { |
| 332 return contents()->GetMainFrame(); | 335 return contents()->GetMainFrame(); |
| 333 } | 336 } |
| 334 | 337 |
| 335 TestWebContents* RenderViewHostImplTestHarness::contents() { | 338 TestWebContents* RenderViewHostImplTestHarness::contents() { |
| 336 return static_cast<TestWebContents*>(web_contents()); | 339 return static_cast<TestWebContents*>(web_contents()); |
| 337 } | 340 } |
| 338 | 341 |
| 339 } // namespace content | 342 } // namespace content |
| OLD | NEW |