Commit 9e25925b authored by Balazs Engedy's avatar Balazs Engedy Committed by Commit Bot

Re-enable PermissionNavigationTest which used to flake on official bots.

The hypothesis is that the system-level geolocation setting may be turned off
on some bots (or by other tests), which then results in the per-origin permission
prompt being suppressed as it is triggered without user gesture.

This CL overrides the system-level setting to be on for the duration of the test.

Bug: 957902
Change-Id: Ia7c3ae27eac87b4dbae0eda328748b59682aefb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632256Reviewed-by: default avatarPavel Yatsuk <pavely@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664179}
parent 5a3ac3e7
......@@ -4,6 +4,8 @@
package org.chromium.chrome.browser.permissions;
import android.support.test.filters.MediumTest;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
......@@ -11,13 +13,14 @@ import org.junit.runner.RunWith;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.permissions.PermissionTestRule.DialogShownCriteria;
import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.util.browser.LocationSettingsTestUtil;
import org.chromium.content_public.browser.NavigationHandle;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
......@@ -38,6 +41,11 @@ public class PermissionNavigationTest {
@Before
public void setUp() throws Exception {
mPermissionRule.setUpActivity();
// Some bots on continuous integration may have the system-level location setting off, in
// which case the permission request would be auto-denied as it will not have a user
// gesture. See: GeolocationPermissionContextAndroid::CanShowLocationSettingsDialog().
LocationSettingsTestUtil.setSystemLocationSettingEnabled(true);
}
/**
......@@ -47,11 +55,9 @@ public class PermissionNavigationTest {
* @throws Exception
*/
@Test
// @MediumTest
// @Feature({"Permissions"})
@MediumTest
@Feature({"Permissions"})
@CommandLineFlags.Add("enable-features=" + PermissionTestRule.MODAL_FLAG)
// Flaky on official bots, https://crbug.com/699851#c8
@DisabledTest
public void testNavigationDismissesModalPermissionPrompt() throws Exception {
mPermissionRule.setUpUrl(TEST_FILE);
mPermissionRule.runJavaScriptCodeInCurrentTab("requestGeolocationPermission()");
......
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