Commit 69041ca1 authored by Francois Doray's avatar Francois Doray Committed by Commit Bot

Re-enable TabManagerTest.TabManagerBasics.

Failure log
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8904107524722548848/+/steps/browser_tests__with_patch_/0/logs/Flaky_failure:_TabManagerTest.TabManagerBasics__status_CRASH_SUCCESS_/0
shows error when navigating to WebUI pages.

Since the test doesn't depend on navigating to a WebUI, this
CL changes it to navigate to a simple test page.

Bug: 997719
Change-Id: Ifcc53fb9d4df5f144e99c2e9c9eaf41614778c24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1869480Reviewed-by: default avatarSébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707932}
parent 6f6da3d9
......@@ -339,13 +339,9 @@ class TabManagerTestWithTwoTabs : public TabManagerTest {
DISALLOW_COPY_AND_ASSIGN(TabManagerTestWithTwoTabs);
};
// Flaky on Linux/ChromeOS only. http://crbug.com/997719
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
#define MAYBE_TabManagerBasics DISABLED_TabManagerBasics
#else
#define MAYBE_TabManagerBasics TabManagerBasics
#endif
IN_PROC_BROWSER_TEST_F(TabManagerTest, MAYBE_TabManagerBasics) {
IN_PROC_BROWSER_TEST_F(TabManagerTest, TabManagerBasics) {
ASSERT_TRUE(embedded_test_server()->Start());
using content::WindowedNotificationObserver;
// Get three tabs open.
......@@ -354,8 +350,8 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, MAYBE_TabManagerBasics) {
WindowedNotificationObserver load1(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
OpenURLParams open1(GURL(chrome::kChromeUIAboutURL), content::Referrer(),
WindowOpenDisposition::CURRENT_TAB,
OpenURLParams open1(embedded_test_server()->GetURL("a.com", "/title1.html"),
content::Referrer(), WindowOpenDisposition::CURRENT_TAB,
ui::PAGE_TRANSITION_TYPED, false);
browser()->OpenURL(open1);
load1.Wait();
......@@ -364,7 +360,8 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, MAYBE_TabManagerBasics) {
WindowedNotificationObserver load2(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
OpenURLParams open2(GURL(chrome::kChromeUICreditsURL), content::Referrer(),
OpenURLParams open2(embedded_test_server()->GetURL("a.com", "/title1.html"),
content::Referrer(),
WindowOpenDisposition::NEW_FOREGROUND_TAB,
ui::PAGE_TRANSITION_TYPED, false);
browser()->OpenURL(open2);
......@@ -374,7 +371,8 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, MAYBE_TabManagerBasics) {
WindowedNotificationObserver load3(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
OpenURLParams open3(GURL(chrome::kChromeUITermsURL), content::Referrer(),
OpenURLParams open3(embedded_test_server()->GetURL("a.com", "/title1.html"),
content::Referrer(),
WindowOpenDisposition::NEW_FOREGROUND_TAB,
ui::PAGE_TRANSITION_TYPED, false);
browser()->OpenURL(open3);
......@@ -386,8 +384,8 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, MAYBE_TabManagerBasics) {
WindowedNotificationObserver load4(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
OpenURLParams open4(GURL(chrome::kChromeUIVersionURL), content::Referrer(),
WindowOpenDisposition::CURRENT_TAB,
OpenURLParams open4(embedded_test_server()->GetURL("a.com", "/title2.html"),
content::Referrer(), WindowOpenDisposition::CURRENT_TAB,
ui::PAGE_TRANSITION_TYPED, false);
browser()->OpenURL(open4);
load4.Wait();
......@@ -396,8 +394,8 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, MAYBE_TabManagerBasics) {
WindowedNotificationObserver load5(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
content::NotificationService::AllSources());
OpenURLParams open5(content::GetWebUIURL("dns"), content::Referrer(),
WindowOpenDisposition::CURRENT_TAB,
OpenURLParams open5(embedded_test_server()->GetURL("a.com", "/title3.html"),
content::Referrer(), WindowOpenDisposition::CURRENT_TAB,
ui::PAGE_TRANSITION_TYPED, false);
browser()->OpenURL(open5);
load5.Wait();
......@@ -456,7 +454,7 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, MAYBE_TabManagerBasics) {
WindowedNotificationObserver reload1(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
base::Bind(&ObserveNavEntryCommitted,
GURL(chrome::kChromeUIChromeURLsURL)));
embedded_test_server()->GetURL("a.com", "/title1.html")));
chrome::SelectNumberedTab(browser(), 0);
reload1.Wait();
// Make sure the FindBarController gets the right WebContents.
......@@ -470,7 +468,8 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, MAYBE_TabManagerBasics) {
// Select the third tab. It should reload.
WindowedNotificationObserver reload2(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
base::Bind(&ObserveNavEntryCommitted, content::GetWebUIURL("dns")));
base::Bind(&ObserveNavEntryCommitted,
embedded_test_server()->GetURL("a.com", "/title3.html")));
chrome::SelectNumberedTab(browser(), 2);
reload2.Wait();
EXPECT_EQ(2, tsm()->active_index());
......@@ -484,14 +483,16 @@ IN_PROC_BROWSER_TEST_F(TabManagerTest, MAYBE_TabManagerBasics) {
EXPECT_FALSE(chrome::CanGoForward(browser()));
WindowedNotificationObserver back1(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
base::Bind(&ObserveNavEntryCommitted, GURL(chrome::kChromeUIVersionURL)));
base::Bind(&ObserveNavEntryCommitted,
embedded_test_server()->GetURL("a.com", "/title2.html")));
chrome::GoBack(browser(), WindowOpenDisposition::CURRENT_TAB);
back1.Wait();
EXPECT_TRUE(chrome::CanGoBack(browser()));
EXPECT_TRUE(chrome::CanGoForward(browser()));
WindowedNotificationObserver back2(
content::NOTIFICATION_NAV_ENTRY_COMMITTED,
base::Bind(&ObserveNavEntryCommitted, GURL(chrome::kChromeUITermsURL)));
base::Bind(&ObserveNavEntryCommitted,
embedded_test_server()->GetURL("a.com", "/title1.html")));
chrome::GoBack(browser(), WindowOpenDisposition::CURRENT_TAB);
back2.Wait();
EXPECT_FALSE(chrome::CanGoBack(browser()));
......
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