Commit c60e58ff authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

Fix flaky test TabletModePageBehaviorTest.ExcludeInternalPages

The test used to navigate to chrome://settings, which may take
a long time causing the test to flake. The test's intent is to
verify correct WebPrefs applied when switching to tablet mode
for internal pages; doesn't have to be the settings page.
Use chrome://version instead.

BUG=1023903
TEST=Run test locally with no flakes

Change-Id: I5bc62a1eb9d67e1d0ca62693110081d4fd512974
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913020
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714698}
parent 9a88266d
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host.h"
...@@ -114,14 +115,13 @@ IN_PROC_BROWSER_TEST_F(TabletModePageBehaviorTest, ...@@ -114,14 +115,13 @@ IN_PROC_BROWSER_TEST_F(TabletModePageBehaviorTest,
} }
IN_PROC_BROWSER_TEST_F(TabletModePageBehaviorTest, ExcludeInternalPages) { IN_PROC_BROWSER_TEST_F(TabletModePageBehaviorTest, ExcludeInternalPages) {
constexpr char kSettingsUrl[] = "chrome://settings/"; AddTabAtIndexToBrowser(browser(), 0, GURL(chrome::kChromeUIVersionURL),
AddTabAtIndexToBrowser(browser(), 0, GURL(kSettingsUrl),
ui::PAGE_TRANSITION_LINK, ui::PAGE_TRANSITION_LINK,
false /* check_navigation_success */); false /* check_navigation_success */);
auto* web_contents = GetActiveWebContents(browser()); auto* web_contents = GetActiveWebContents(browser());
ASSERT_TRUE(web_contents); ASSERT_TRUE(web_contents);
EXPECT_STREQ(web_contents->GetLastCommittedURL().spec().c_str(), EXPECT_STREQ(web_contents->GetLastCommittedURL().spec().c_str(),
kSettingsUrl); chrome::kChromeUIVersionURL);
// Now enable tablet mode, and expect that this internal page's web prefs // Now enable tablet mode, and expect that this internal page's web prefs
// remain unaffected as if tablet mode is off. // remain unaffected as if tablet mode is off.
......
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