Commit c6f930f9 authored by Fergal Daly's avatar Fergal Daly Committed by Commit Bot

Add new test to ensure that reload after chrome://kill works.

https://crrev.com/c/2006890 will reland a CL that broke this.

This test "correctly" fails when patched onto
f4c4a4aa however it passes when patched
onto the reland. Manual testing of the reland also does not trigger
the bug, so I guess something changed but having an automated
regression test seems wise.

Bug: 981339, 993701
Change-Id: I048868e3181f9c3b0c856ce8553226fe29acc696
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2011585
Commit-Queue: Fergal Daly <fergal@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733966}
parent 4486e79b
...@@ -664,6 +664,35 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, AccessiblePopup) { ...@@ -664,6 +664,35 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, AccessiblePopup) {
EXPECT_FALSE(popup_node_data_2.HasState(ax::mojom::State::kInvisible)); EXPECT_FALSE(popup_node_data_2.HasState(ax::mojom::State::kInvisible));
} }
// Omnibox returns to clean state after chrome://kill and reload.
// https://crbug.com/993701 left the URL and icon as chrome://kill after reload.
IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, ReloadAfterKill) {
OmniboxView* omnibox_view = nullptr;
ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &omnibox_view));
OmniboxViewViews* omnibox_view_views =
static_cast<OmniboxViewViews*>(omnibox_view);
// Open new tab page.
ui_test_utils::NavigateToURL(browser(), GURL("chrome://newtab"));
content::WebContents* tab =
browser()->tab_strip_model()->GetActiveWebContents();
// Kill the tab with chrome://kill
{
content::ScopedAllowRendererCrashes scoped_allow_renderer_crashes;
ui_test_utils::NavigateToURL(browser(), GURL("chrome://kill"));
EXPECT_TRUE(tab->IsCrashed());
}
// Reload the tab.
tab->GetController().Reload(content::ReloadType::NORMAL, false);
content::WaitForLoadStop(tab);
// Verify the omnibox contents, URL and icon.
EXPECT_EQ(base::ASCIIToUTF16(""), omnibox_view_views->GetText());
EXPECT_EQ(GURL("about:blank"), browser()->location_bar_model()->GetURL());
}
// The following set of tests require UIA accessibility support, which only // The following set of tests require UIA accessibility support, which only
// exists on Windows. // exists on Windows.
#if defined(OS_WIN) #if defined(OS_WIN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment