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/browser/renderer_host/test_render_view_host.h" | 5 #include "content/browser/renderer_host/test_render_view_host.h" |
6 | 6 |
7 #include "content/browser/dom_storage/dom_storage_context_impl.h" | 7 #include "content/browser/dom_storage/dom_storage_context_impl.h" |
8 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 8 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
9 #include "content/browser/renderer_host/test_backing_store.h" | 9 #include "content/browser/renderer_host/test_backing_store.h" |
10 #include "content/browser/site_instance_impl.h" | 10 #include "content/browser/site_instance_impl.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
353 } | 353 } |
354 | 354 |
355 void TestRenderViewHost::TestOnStartDragging( | 355 void TestRenderViewHost::TestOnStartDragging( |
356 const WebDropData& drop_data) { | 356 const WebDropData& drop_data) { |
357 WebKit::WebDragOperationsMask drag_operation = WebKit::WebDragOperationEvery; | 357 WebKit::WebDragOperationsMask drag_operation = WebKit::WebDragOperationEvery; |
358 DragEventSourceInfo event_info; | 358 DragEventSourceInfo event_info; |
359 OnStartDragging(drop_data, drag_operation, SkBitmap(), gfx::Vector2d(), | 359 OnStartDragging(drop_data, drag_operation, SkBitmap(), gfx::Vector2d(), |
360 event_info); | 360 event_info); |
361 } | 361 } |
362 | 362 |
363 void TestRenderViewHost::TestOnUpdateStateWithFile( | |
364 int process_id, | |
365 const std::string& file_name) { | |
366 WebKit::WebHTTPBody http_body; | |
367 http_body.initialize(); | |
368 const char char_data[] = "data"; | |
369 http_body.appendData(WebKit::WebData(char_data, sizeof(char_data)-1)); | |
darin (slow to review)
2013/05/06 23:39:47
nit: use arraysize() instead of sizeof() just to b
| |
370 http_body.appendFile(WebKit::WebString::fromUTF8(file_name)); | |
371 | |
372 WebKit::WebHistoryItem history_item; | |
373 history_item.initialize(); | |
374 history_item.setURLString("about::blank"); | |
darin (slow to review)
2013/05/06 23:39:47
nit: Using "about:blank" here might make this test
| |
375 history_item.setHTTPBody(http_body); | |
376 OnUpdateState(process_id, webkit_glue::HistoryItemToString(history_item)); | |
377 } | |
378 | |
363 void TestRenderViewHost::set_simulate_fetch_via_proxy(bool proxy) { | 379 void TestRenderViewHost::set_simulate_fetch_via_proxy(bool proxy) { |
364 simulate_fetch_via_proxy_ = proxy; | 380 simulate_fetch_via_proxy_ = proxy; |
365 } | 381 } |
366 | 382 |
367 void TestRenderViewHost::set_simulate_history_list_was_cleared(bool cleared) { | 383 void TestRenderViewHost::set_simulate_history_list_was_cleared(bool cleared) { |
368 simulate_history_list_was_cleared_ = cleared; | 384 simulate_history_list_was_cleared_ = cleared; |
369 } | 385 } |
370 | 386 |
371 RenderViewHostImplTestHarness::RenderViewHostImplTestHarness() { | 387 RenderViewHostImplTestHarness::RenderViewHostImplTestHarness() { |
372 } | 388 } |
(...skipping 11 matching lines...) Expand all Loading... | |
384 | 400 |
385 TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() { | 401 TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() { |
386 return static_cast<TestRenderViewHost*>(active_rvh()); | 402 return static_cast<TestRenderViewHost*>(active_rvh()); |
387 } | 403 } |
388 | 404 |
389 TestWebContents* RenderViewHostImplTestHarness::contents() { | 405 TestWebContents* RenderViewHostImplTestHarness::contents() { |
390 return static_cast<TestWebContents*>(web_contents()); | 406 return static_cast<TestWebContents*>(web_contents()); |
391 } | 407 } |
392 | 408 |
393 } // namespace content | 409 } // namespace content |
OLD | NEW |