Chromium Code Reviews| Index: chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc |
| diff --git a/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc b/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc |
| index f054a8138bacc13ad5f19903376645b435b4c793..68b64afe518ce8a7352758d7609504f1916bb021 100644 |
| --- a/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc |
| +++ b/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc |
| @@ -60,3 +60,23 @@ IN_PROC_BROWSER_TEST_F(MdSettingsUITest, ToggleJavaScript) { |
| handler->AllowJavascriptForTesting(); |
| } |
| } |
| + |
| +IN_PROC_BROWSER_TEST_F(MdSettingsUITest, InPageNavigations) { |
| + NavigateToURL(browser(), GURL(chrome::kChromeUIMdSettingsURL)); |
| + |
| + auto handlers = browser()->tab_strip_model()->GetActiveWebContents() |
| + ->GetWebUI()->GetHandlersForTesting(); |
| + for (content::WebUIMessageHandler* handler : *handlers) { |
|
Charlie Reis
2016/06/25 00:02:19
nit: No braces needed. Same below.
tommycli
2016/06/25 00:12:17
Done.
|
| + handler->AllowJavascriptForTesting(); |
| + } |
| + |
| + // Push onto window.history. Back should now be an in-page navigation. |
| + ASSERT_TRUE(content::ExecuteScript( |
| + browser()->tab_strip_model()->GetActiveWebContents(), |
| + "window.history.pushState({}, '', 'foo.html')")); |
| + chrome::GoBack(browser(), CURRENT_TAB); |
|
Charlie Reis
2016/06/25 00:02:19
You might need to use WaitForLoadStop to avoid fla
tommycli
2016/06/25 00:12:17
I didn't detect any flakiness on my machine (the t
|
| + |
| + for (content::WebUIMessageHandler* handler : *handlers) { |
| + EXPECT_TRUE(handler->IsJavascriptAllowed()); |
| + } |
| +} |