Commit b77db01a authored by Reid Kleckner's avatar Reid Kleckner Committed by Commit Bot

Revert "Add tests that lookalike interstitial decisions are shared with incognito."

This reverts commit 281e80c3.

Reason for revert:
New test fails in official builds:
https://uberchromegw.corp.google.com/i/official.desktop.continuous/builders/win%20trunk/builds/104341
https://ci.chromium.org/p/chrome/builders/ci/ToTWin64/3351

Original change's description:
> Add tests that lookalike interstitial decisions are shared with incognito.
> 
> This CL adds tests to verify that a decision to bypass the lookalike
> interstitial made in the main profile does not affect incognito and vice
> versa.
> 
> Bug: 927924
> Change-Id: I238e2e263db42c1434b9190de007aa775129417e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1506458
> Commit-Queue: Joe DeBlasio <jdeblasio@chromium.org>
> Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#638329}

TBR=meacer@chromium.org,jdeblasio@chromium.org

Change-Id: I68dbe18b841f4022ae0b533402d1f7fe1fa377b3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 927924
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1509333Reviewed-by: default avatarReid Kleckner <rnk@chromium.org>
Commit-Queue: Reid Kleckner <rnk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638685}
parent ae32c22f
...@@ -134,7 +134,7 @@ void NavigateToURLSync(Browser* browser, const GURL& url) { ...@@ -134,7 +134,7 @@ void NavigateToURLSync(Browser* browser, const GURL& url) {
} }
// Load given URL and verify that it loaded an interstitial and hid the URL. // Load given URL and verify that it loaded an interstitial and hid the URL.
void LoadAndCheckInterstitialAt(Browser* browser, const GURL& url) { void LoadInterstitialAt(Browser* browser, const GURL& url) {
content::WebContents* web_contents = content::WebContents* web_contents =
browser->tab_strip_model()->GetActiveWebContents(); browser->tab_strip_model()->GetActiveWebContents();
...@@ -275,7 +275,7 @@ class LookalikeUrlNavigationThrottleBrowserTest ...@@ -275,7 +275,7 @@ class LookalikeUrlNavigationThrottleBrowserTest
browser->profile(), ServiceAccessType::EXPLICIT_ACCESS); browser->profile(), ServiceAccessType::EXPLICIT_ACCESS);
ui_test_utils::WaitForHistoryToLoad(history_service); ui_test_utils::WaitForHistoryToLoad(history_service);
LoadAndCheckInterstitialAt(browser, navigated_url); LoadInterstitialAt(browser, navigated_url);
SendInterstitialCommandSync(browser, SendInterstitialCommandSync(browser,
SecurityInterstitialCommand::CMD_DONT_PROCEED); SecurityInterstitialCommand::CMD_DONT_PROCEED);
EXPECT_EQ(expected_suggested_url, EXPECT_EQ(expected_suggested_url,
...@@ -326,7 +326,7 @@ class LookalikeUrlNavigationThrottleBrowserTest ...@@ -326,7 +326,7 @@ class LookalikeUrlNavigationThrottleBrowserTest
browser->profile(), ServiceAccessType::EXPLICIT_ACCESS); browser->profile(), ServiceAccessType::EXPLICIT_ACCESS);
ui_test_utils::WaitForHistoryToLoad(history_service); ui_test_utils::WaitForHistoryToLoad(history_service);
LoadAndCheckInterstitialAt(browser, navigated_url); LoadInterstitialAt(browser, navigated_url);
// Clicking the ignore button in the interstitial should remove the // Clicking the ignore button in the interstitial should remove the
// interstitial and navigate to the original URL. // interstitial and navigate to the original URL.
...@@ -691,11 +691,11 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -691,11 +691,11 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
const GURL kNavigatedUrl = const GURL kNavigatedUrl =
GetLongRedirect("goooglé.com", "example.net", "example.com"); GetLongRedirect("goooglé.com", "example.net", "example.com");
SetEngagementScore(browser(), kNavigatedUrl, kLowEngagement); SetEngagementScore(browser(), kNavigatedUrl, kLowEngagement);
LoadAndCheckInterstitialAt(browser(), kNavigatedUrl); LoadInterstitialAt(browser(), kNavigatedUrl);
} }
// LoadAndCheckInterstitialAt assumes there's not an interstitial already // LoadInterstitialAt assumes there's not an interstitial already showing
// showing (since otherwise it can't be sure that the navigation caused it). // (since otherwise it can't be sure that the navigation caused it).
NavigateToURLSync(browser(), GetURL("example.com")); NavigateToURLSync(browser(), GetURL("example.com"));
{ {
...@@ -703,7 +703,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -703,7 +703,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
const GURL kNavigatedUrl = const GURL kNavigatedUrl =
GetLongRedirect("example.net", "goooglé.com", "example.com"); GetLongRedirect("example.net", "goooglé.com", "example.com");
SetEngagementScore(browser(), kNavigatedUrl, kLowEngagement); SetEngagementScore(browser(), kNavigatedUrl, kLowEngagement);
LoadAndCheckInterstitialAt(browser(), kNavigatedUrl); LoadInterstitialAt(browser(), kNavigatedUrl);
} }
} }
...@@ -727,7 +727,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -727,7 +727,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
const GURL navigated_url = GetURL("goooglé.com"); const GURL navigated_url = GetURL("goooglé.com");
const GURL subsequent_url = GetURL("example.com"); const GURL subsequent_url = GetURL("example.com");
LoadAndCheckInterstitialAt(browser(), navigated_url); LoadInterstitialAt(browser(), navigated_url);
NavigateToURLSync(browser(), subsequent_url); NavigateToURLSync(browser(), subsequent_url);
CheckUkm({navigated_url}, "UserAction", UserAction::kCloseOrBack); CheckUkm({navigated_url}, "UserAction", UserAction::kCloseOrBack);
} }
...@@ -738,7 +738,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -738,7 +738,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
UkmRecordedAfterSuggestionAccepted) { UkmRecordedAfterSuggestionAccepted) {
const GURL navigated_url = GetURL("goooglé.com"); const GURL navigated_url = GetURL("goooglé.com");
LoadAndCheckInterstitialAt(browser(), navigated_url); LoadInterstitialAt(browser(), navigated_url);
SendInterstitialCommandSync(browser(), SendInterstitialCommandSync(browser(),
SecurityInterstitialCommand::CMD_DONT_PROCEED); SecurityInterstitialCommand::CMD_DONT_PROCEED);
CheckUkm({navigated_url}, "UserAction", UserAction::kAcceptSuggestion); CheckUkm({navigated_url}, "UserAction", UserAction::kAcceptSuggestion);
...@@ -750,7 +750,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -750,7 +750,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
UkmRecordedAfterSuggestionIgnored) { UkmRecordedAfterSuggestionIgnored) {
const GURL navigated_url = GetURL("goooglé.com"); const GURL navigated_url = GetURL("goooglé.com");
LoadAndCheckInterstitialAt(browser(), navigated_url); LoadInterstitialAt(browser(), navigated_url);
SendInterstitialCommandSync(browser(), SendInterstitialCommandSync(browser(),
SecurityInterstitialCommand::CMD_PROCEED); SecurityInterstitialCommand::CMD_PROCEED);
CheckUkm({navigated_url}, "UserAction", UserAction::kClickThrough); CheckUkm({navigated_url}, "UserAction", UserAction::kClickThrough);
...@@ -759,7 +759,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -759,7 +759,7 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
// Verify that the URL shows normally on pages after a lookalike interstitial. // Verify that the URL shows normally on pages after a lookalike interstitial.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
UrlShownAfterInterstitial) { UrlShownAfterInterstitial) {
LoadAndCheckInterstitialAt(browser(), GetURL("goooglé.com")); LoadInterstitialAt(browser(), GetURL("goooglé.com"));
// URL should be showing again when we navigate to a normal URL // URL should be showing again when we navigate to a normal URL
NavigateToURLSync(browser(), GetURL("example.com")); NavigateToURLSync(browser(), GetURL("example.com"));
...@@ -769,39 +769,3 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest, ...@@ -769,39 +769,3 @@ IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
NavigateToURLSync(browser(), GURL("chrome://newtab")); NavigateToURLSync(browser(), GURL("chrome://newtab"));
EXPECT_FALSE(IsUrlShowing(browser())); EXPECT_FALSE(IsUrlShowing(browser()));
} }
// Verify that bypassing warnings in the main profile does not affect incognito.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
MainProfileDoesNotAffectIncognito) {
const GURL kNavigatedUrl = GetURL("googlé.com");
// Set low engagement scores in the main profile and in incognito.
Browser* incognito = CreateIncognitoBrowser();
SetEngagementScore(browser(), kNavigatedUrl, kLowEngagement);
SetEngagementScore(incognito, kNavigatedUrl, kLowEngagement);
LoadAndCheckInterstitialAt(browser(), kNavigatedUrl);
// PROCEEDing will disable the interstitial on subsequent navigations
SendInterstitialCommandSync(browser(),
SecurityInterstitialCommand::CMD_PROCEED);
LoadAndCheckInterstitialAt(incognito, kNavigatedUrl);
}
// Verify that bypassing warnings in incognito does not affect the main profile.
IN_PROC_BROWSER_TEST_F(LookalikeUrlInterstitialPageBrowserTest,
IncognitoDoesNotAffectMainProfile) {
const GURL kNavigatedUrl = GetURL("googlé.com");
// Set low engagement scores in the main profile and in incognito.
Browser* incognito = CreateIncognitoBrowser();
SetEngagementScore(browser(), kNavigatedUrl, kLowEngagement);
SetEngagementScore(incognito, kNavigatedUrl, kLowEngagement);
LoadAndCheckInterstitialAt(incognito, kNavigatedUrl);
// PROCEEDing will disable the interstitial on subsequent navigations
SendInterstitialCommandSync(incognito,
SecurityInterstitialCommand::CMD_PROCEED);
LoadAndCheckInterstitialAt(browser(), kNavigatedUrl);
}
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