Commit 793ad828 authored by Christian Dullweber's avatar Christian Dullweber Committed by Commit Bot

Fix and enable SiteSettingsTest#testSiteExceptionCookiesBlocked

Close settings activity before loading a URL to try to avoid
flakiness.

Bug: 1139480
Change-Id: I4e9b617941f07fc3baa313ddf10b6c9cb656990c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2526341Reviewed-by: default avatarChristian Dullweber <dullweber@chromium.org>
Reviewed-by: default avatarEhimare Okoyomon <eokoyomon@chromium.org>
Reviewed-by: default avatarAndy Paicu <andypaicu@chromium.org>
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825743}
parent c43ef308
...@@ -415,10 +415,7 @@ public class SiteSettingsTest { ...@@ -415,10 +415,7 @@ public class SiteSettingsTest {
@Test @Test
@SmallTest @SmallTest
@Feature({"Preferences"}) @Feature({"Preferences"})
// Todo(eokoyomon) figure out how to set and test third party cookie setting in this test // TODO(eokoyomon) figure out how to set and test third party cookie setting in this test
// @EnableFeatures(
// ContentSettingsFeatureList.IMPROVED_COOKIE_CONTROLS_FOR_THIRD_PARTY_COOKIE_BLOCKING)
@FlakyTest(message = "https://crbug.com/1139480")
public void testSiteExceptionCookiesBlocked() throws Exception { public void testSiteExceptionCookiesBlocked() throws Exception {
SettingsActivity settingsActivity = SettingsActivity settingsActivity =
SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES);
...@@ -443,14 +440,13 @@ public class SiteSettingsTest { ...@@ -443,14 +440,13 @@ public class SiteSettingsTest {
settingsActivity = settingsActivity =
SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES); SiteSettingsTestUtils.startSiteSettingsCategory(SiteSettingsCategory.Type.COOKIES);
setBlockCookiesSiteException(settingsActivity, url, false); setBlockCookiesSiteException(settingsActivity, url, false);
settingsActivity.finish();
mPermissionRule.runJavaScriptCodeInCurrentTab("setCookie()"); mPermissionRule.runJavaScriptCodeInCurrentTab("setCookie()");
Assert.assertEquals("\"\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()")); Assert.assertEquals("\"\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()"));
// Load the page again and ensure the cookie remains unset. // Load the page again and ensure the cookie remains unset.
mPermissionRule.loadUrl(url); mPermissionRule.loadUrl(url);
Assert.assertEquals("\"\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()")); Assert.assertEquals("\"\"", mPermissionRule.runJavaScriptCodeInCurrentTab("getCookie()"));
settingsActivity.finish();
} }
/** /**
......
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