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

Unified Diff: content/browser/frame_host/navigation_controller_impl_browsertest.cc

Issue 1008593004: Add Javascript back/forth/go to the NAVIGATION_TYPE_EXISTING_PAGE classification test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl_browsertest.cc
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
index abfba5c8f6b59bb4bb553d0e298d8707799aec69..37ecad7b0bba460cf249cdad030f6a944793df35 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -396,7 +396,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
GetFrameTree()->root();
{
- // Back.
+ // Back from the browser side.
FrameNavigateParamsCapturer capturer(root);
shell()->web_contents()->GetController().GoBack();
capturer.Wait();
@@ -408,7 +408,7 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
}
{
- // Forward.
+ // Forward from the browser side.
FrameNavigateParamsCapturer capturer(root);
shell()->web_contents()->GetController().GoForward();
capturer.Wait();
@@ -420,6 +420,58 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
}
{
+ // Back from the renderer side.
+ FrameNavigateParamsCapturer capturer(root);
+ EXPECT_TRUE(content::ExecuteScript(root->current_frame_host(),
+ "history.back()"));
+ capturer.Wait();
+ EXPECT_EQ(ui::PAGE_TRANSITION_TYPED
Charlie Reis 2015/03/16 19:55:51 It's TYPED for renderer-initiated back/forward? I
Avi (use Gerrit) 2015/03/16 22:18:36 I haven't the slightest clue.
+ | ui::PAGE_TRANSITION_FORWARD_BACK
+ | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR,
+ capturer.params().transition);
+ EXPECT_EQ(NAVIGATION_TYPE_EXISTING_PAGE, capturer.details().type);
+ }
+
+ {
+ // Forward from the renderer side.
+ FrameNavigateParamsCapturer capturer(root);
+ EXPECT_TRUE(content::ExecuteScript(root->current_frame_host(),
+ "history.forward()"));
+ capturer.Wait();
+ EXPECT_EQ(ui::PAGE_TRANSITION_TYPED
+ | ui::PAGE_TRANSITION_FORWARD_BACK
+ | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR,
+ capturer.params().transition);
+ EXPECT_EQ(NAVIGATION_TYPE_EXISTING_PAGE, capturer.details().type);
+ }
+
+ {
+ // Back from the renderer side via history.go().
+ FrameNavigateParamsCapturer capturer(root);
+ EXPECT_TRUE(content::ExecuteScript(root->current_frame_host(),
+ "history.go(-1)"));
+ capturer.Wait();
+ EXPECT_EQ(ui::PAGE_TRANSITION_TYPED
+ | ui::PAGE_TRANSITION_FORWARD_BACK
+ | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR,
+ capturer.params().transition);
+ EXPECT_EQ(NAVIGATION_TYPE_EXISTING_PAGE, capturer.details().type);
+ }
+
+ {
+ // Forward from the renderer side via history.go().
+ FrameNavigateParamsCapturer capturer(root);
+ EXPECT_TRUE(content::ExecuteScript(root->current_frame_host(),
+ "history.go(1)"));
+ capturer.Wait();
+ EXPECT_EQ(ui::PAGE_TRANSITION_TYPED
+ | ui::PAGE_TRANSITION_FORWARD_BACK
+ | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR,
+ capturer.params().transition);
+ EXPECT_EQ(NAVIGATION_TYPE_EXISTING_PAGE, capturer.details().type);
+ }
+
+ {
// Reload from the browser side.
FrameNavigateParamsCapturer capturer(root);
shell()->web_contents()->GetController().Reload(false);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698