Commit d6c85942 authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Fix failing data reduction proxy test

The test only fails on official builds where the
field trials command line switch is not working.

This CL updates the test to bail out earlier if the
command line switch is not working.

Bug: 813599
Change-Id: I1c0be03b4977782e590568930273a95372ab0f47
Reviewed-on: https://chromium-review.googlesource.com/939647Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539551}
parent e8375988
...@@ -65,8 +65,12 @@ public class DataReductionPromoUtilsTest { ...@@ -65,8 +65,12 @@ public class DataReductionPromoUtilsTest {
testCanShowPromos() throws Throwable { testCanShowPromos() throws Throwable {
if (DataReductionProxySettings.getInstance().isDataReductionProxyManaged()) return; if (DataReductionProxySettings.getInstance().isDataReductionProxyManaged()) return;
Assert.assertFalse(DataReductionProxySettings.getInstance().isDataReductionProxyEnabled()); Assert.assertFalse(DataReductionProxySettings.getInstance().isDataReductionProxyEnabled());
Assert.assertTrue(FieldTrialList.findFullName("DataCompressionProxyPromoVisibility")
.equals("Enabled")); // In some unknown cases, the force-fieldtrials flag may not be effective. This may possibly
// be because this test runs on UiThread.
if (!FieldTrialList.findFullName("DataCompressionProxyPromoVisibility").equals("Enabled")) {
return;
}
Assert.assertTrue( Assert.assertTrue(
DataReductionProxySettings.getInstance().isDataReductionProxyPromoAllowed()); DataReductionProxySettings.getInstance().isDataReductionProxyPromoAllowed());
Assert.assertTrue(DataReductionPromoUtils.canShowPromos()); Assert.assertTrue(DataReductionPromoUtils.canShowPromos());
......
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