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

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

Issue 1497743005: Allow huge data: URIs only via WebView.loadDataWithBaseUrl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sort out the tests Created 5 years 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 <cctype> 7 #include <cctype>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 void RenderViewTest::SetFocused(const blink::WebNode& node) { 462 void RenderViewTest::SetFocused(const blink::WebNode& node) {
463 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 463 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
464 impl->focusedNodeChanged(blink::WebNode(), node); 464 impl->focusedNodeChanged(blink::WebNode(), node);
465 } 465 }
466 466
467 void RenderViewTest::Reload(const GURL& url) { 467 void RenderViewTest::Reload(const GURL& url) {
468 CommonNavigationParams common_params( 468 CommonNavigationParams common_params(
469 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD, 469 url, Referrer(), ui::PAGE_TRANSITION_LINK, FrameMsg_Navigate_Type::RELOAD,
470 true, false, base::TimeTicks(), 470 true, false, base::TimeTicks(),
471 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), 471 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
472 LOFI_UNSPECIFIED, base::TimeTicks::Now()); 472 std::string(), LOFI_UNSPECIFIED, base::TimeTicks::Now());
473 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 473 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
474 TestRenderFrame* frame = 474 TestRenderFrame* frame =
475 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 475 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
476 frame->Navigate(common_params, StartNavigationParams(), 476 frame->Navigate(common_params, StartNavigationParams(),
477 RequestNavigationParams()); 477 RequestNavigationParams());
478 FrameLoadWaiter(frame).Wait(); 478 FrameLoadWaiter(frame).Wait();
479 } 479 }
480 480
481 uint32 RenderViewTest::GetNavigationIPCType() { 481 uint32 RenderViewTest::GetNavigationIPCType() {
482 return FrameHostMsg_DidCommitProvisionalLoad::ID; 482 return FrameHostMsg_DidCommitProvisionalLoad::ID;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); 595 RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
596 596
597 int history_list_length = impl->historyBackListCount() + 597 int history_list_length = impl->historyBackListCount() +
598 impl->historyForwardListCount() + 1; 598 impl->historyForwardListCount() + 1;
599 int pending_offset = offset + impl->history_list_offset_; 599 int pending_offset = offset + impl->history_list_offset_;
600 600
601 CommonNavigationParams common_params( 601 CommonNavigationParams common_params(
602 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, 602 GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK,
603 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), 603 FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(),
604 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), 604 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(),
605 LOFI_UNSPECIFIED, base::TimeTicks::Now()); 605 std::string(), LOFI_UNSPECIFIED, base::TimeTicks::Now());
606 RequestNavigationParams request_params; 606 RequestNavigationParams request_params;
607 request_params.page_state = state; 607 request_params.page_state = state;
608 request_params.page_id = impl->page_id_ + offset; 608 request_params.page_id = impl->page_id_ + offset;
609 request_params.nav_entry_id = pending_offset + 1; 609 request_params.nav_entry_id = pending_offset + 1;
610 request_params.pending_history_list_offset = pending_offset; 610 request_params.pending_history_list_offset = pending_offset;
611 request_params.current_history_list_offset = impl->history_list_offset_; 611 request_params.current_history_list_offset = impl->history_list_offset_;
612 request_params.current_history_list_length = history_list_length; 612 request_params.current_history_list_length = history_list_length;
613 613
614 TestRenderFrame* frame = 614 TestRenderFrame* frame =
615 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame()); 615 static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
616 frame->Navigate(common_params, StartNavigationParams(), request_params); 616 frame->Navigate(common_params, StartNavigationParams(), request_params);
617 617
618 // The load actually happens asynchronously, so we pump messages to process 618 // The load actually happens asynchronously, so we pump messages to process
619 // the pending continuation. 619 // the pending continuation.
620 FrameLoadWaiter(frame).Wait(); 620 FrameLoadWaiter(frame).Wait();
621 } 621 }
622 622
623 } // namespace content 623 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698