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 81e71a0c95388d93b912c59c1f77cbbb2f466105..d9d0ff01c0e31f6484dc05d380f2579e6cc26e7a 100644 |
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc |
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc |
@@ -203,6 +203,39 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
} |
} |
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, |
+ FragmentNavigateFromLoadDataWithBaseURL) { |
+ const GURL base_url("http://baseurl"); |
+ const GURL history_url("http://historyurl"); |
+ const std::string data = |
+ "<html><body>" |
+ " <p id=\"frag\"><a id=\"fraglink\" href=\"#frag\">in-page nav</a></p>" |
+ "</body></html>"; |
+ |
+ const NavigationControllerImpl& controller = |
+ static_cast<const NavigationControllerImpl&>( |
+ shell()->web_contents()->GetController()); |
+ |
+ // Load data and commit. |
+ TestNavigationObserver same_tab_observer(shell()->web_contents(), 1); |
+#if defined(OS_ANDROID) |
+ shell()->LoadDataAsStringWithBaseURL(history_url, data, base_url); |
+#else |
+ shell()->LoadDataWithBaseURL(history_url, data, base_url); |
+#endif |
+ same_tab_observer.Wait(); |
+ EXPECT_EQ(1, controller.GetEntryCount()); |
+ |
+ // Performance a fragment navigation using a javascript: URL. |
Charlie Reis
2016/03/16 19:30:34
Perform?
|
+ GURL js_url("javascript:document.location = '#frag';"); |
+ NavigateToURL(shell(), js_url); |
+ EXPECT_EQ(2, controller.GetEntryCount()); |
Charlie Reis
2016/03/16 19:30:34
Please add some expectations about what the variou
boliu
2016/03/16 20:18:21
On trunk these values are
Base url: empty
virtual
boliu
2016/03/16 20:26:07
I uploaded PS3 with all the other comments address
boliu
2016/03/16 20:38:32
Err, wait, these are just the expectations for a j
|
+ |
+ // Passes if renderer is still alive. |
+ EXPECT_TRUE( |
+ ExecuteScript(shell()->web_contents(), "console.log('Success');")); |
+} |
+ |
IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, UniqueIDs) { |
const NavigationControllerImpl& controller = |
static_cast<const NavigationControllerImpl&>( |