diff options
author | clamy <clamy@chromium.org> | 2016-03-23 15:13:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-23 22:14:58 +0000 |
commit | 2c11358348eb568cfddf14ef7c7c7b891607e148 (patch) | |
tree | 3e484f4eaeb3d024a160c5a3d20f5796bfa89d31 /content/public | |
parent | 2a2656a67bd2ce190df4d918f609bdb4449a64fe (diff) | |
download | chromium_src-2c11358348eb568cfddf14ef7c7c7b891607e148.zip chromium_src-2c11358348eb568cfddf14ef7c7c7b891607e148.tar.gz chromium_src-2c11358348eb568cfddf14ef7c7c7b891607e148.tar.bz2 |
PlzNavigate: fix two RenderViewImplTests related to history
This CL fixes
RenderViewImplTest.BrowserNavigationStartNotUsedForHistoryNavigation and
RenderViewImplTest.TestBackForward. Properly simulatin ghistory navigations
with PlzNavigate enabled requires providing a url in the
CommonNavigationParams, which was not being done.
BUG=475027
Review URL: https://codereview.chromium.org/1797393008
Cr-Commit-Position: refs/heads/master@{#382940}
Diffstat (limited to 'content/public')
-rw-r--r-- | content/public/test/render_view_test.cc | 14 | ||||
-rw-r--r-- | content/public/test/render_view_test.h | 6 |
2 files changed, 11 insertions, 9 deletions
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc index 572e008..b9e869f 100644 --- a/content/public/test/render_view_test.cc +++ b/content/public/test/render_view_test.cc @@ -280,12 +280,12 @@ PageState RenderViewTest::GetCurrentPageState() { } } -void RenderViewTest::GoBack(const PageState& state) { - GoToOffset(-1, state); +void RenderViewTest::GoBack(const GURL& url, const PageState& state) { + GoToOffset(-1, url, state); } -void RenderViewTest::GoForward(const PageState& state) { - GoToOffset(1, state); +void RenderViewTest::GoForward(const GURL& url, const PageState& state) { + GoToOffset(1, url, state); } void RenderViewTest::SetUp() { @@ -697,7 +697,9 @@ scoped_ptr<ResizeParams> RenderViewTest::InitialSizeParams() { return make_scoped_ptr(new ResizeParams()); } -void RenderViewTest::GoToOffset(int offset, const PageState& state) { +void RenderViewTest::GoToOffset(int offset, + const GURL& url, + const PageState& state) { RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_); int history_list_length = impl->historyBackListCount() + @@ -705,7 +707,7 @@ void RenderViewTest::GoToOffset(int offset, const PageState& state) { int pending_offset = offset + impl->history_list_offset_; CommonNavigationParams common_params( - GURL(), Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, + url, Referrer(), ui::PAGE_TRANSITION_FORWARD_BACK, FrameMsg_Navigate_Type::NORMAL, true, false, base::TimeTicks(), FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_UNSPECIFIED, base::TimeTicks::Now(), "GET"); diff --git a/content/public/test/render_view_test.h b/content/public/test/render_view_test.h index 3c3b3f8..7fb7653 100644 --- a/content/public/test/render_view_test.h +++ b/content/public/test/render_view_test.h @@ -103,8 +103,8 @@ class RenderViewTest : public testing::Test, blink::WebLeakDetectorClient { // Navigates the main frame back or forward in session history and commits. // The caller must capture a PageState for the target page. - void GoBack(const PageState& state); - void GoForward(const PageState& state); + void GoBack(const GURL& url, const PageState& state); + void GoForward(const GURL& url, const PageState& state); // Sends one native key event over IPC. void SendNativeKeyEvent(const NativeWebKeyboardEvent& key_event); @@ -213,7 +213,7 @@ class RenderViewTest : public testing::Test, blink::WebLeakDetectorClient { #endif private: - void GoToOffset(int offset, const PageState& state); + void GoToOffset(int offset, const GURL& url, const PageState& state); }; } // namespace content |