Commit 1b1fe001 authored by Wenyu Fu's avatar Wenyu Fu Committed by Chromium LUCI CQ

Read isFirstRunFlowComplete from shared preference

When test is batching, FirstRunStatus#getFirstRunFlowComplete could
stored wrong value to restore due to commandline switch. Replace the
original value from the shared preference directly.

Bug: 1158467
Change-Id: I5dccfe3b28167c78c04f5ea04b348faff20677a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2591232Reviewed-by: default avatarDonn Denman <donnd@chromium.org>
Commit-Queue: Wenyu Fu <wenyufu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836861}
parent 21c1a519
...@@ -89,6 +89,7 @@ import org.chromium.chrome.browser.layouts.animation.CompositorAnimationHandler; ...@@ -89,6 +89,7 @@ import org.chromium.chrome.browser.layouts.animation.CompositorAnimationHandler;
import org.chromium.chrome.browser.locale.LocaleManager; import org.chromium.chrome.browser.locale.LocaleManager;
import org.chromium.chrome.browser.omnibox.UrlBar; import org.chromium.chrome.browser.omnibox.UrlBar;
import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabCreationState; import org.chromium.chrome.browser.tab.TabCreationState;
import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver;
...@@ -3329,7 +3330,10 @@ public class ContextualSearchManagerTest { ...@@ -3329,7 +3330,10 @@ public class ContextualSearchManagerTest {
public void testFirstRunNotCompleted(@EnabledFeature int enabledFeature) throws Exception { public void testFirstRunNotCompleted(@EnabledFeature int enabledFeature) throws Exception {
// Store the original value in a temp, and mark the first run as not completed // Store the original value in a temp, and mark the first run as not completed
// for this test case. // for this test case.
boolean originalIsFirstRunComplete = FirstRunStatus.getFirstRunFlowComplete(); // Getting value from shared preference rather than FirstRunStatus#getFirstRunFlowComplete
// to get rid of the impact from commandline switch. See https://crbug.com/1158467
boolean originalIsFirstRunComplete = SharedPreferencesManager.getInstance().readBoolean(
ChromePreferenceKeys.FIRST_RUN_FLOW_COMPLETE, false);
FirstRunStatus.setFirstRunFlowComplete(false); FirstRunStatus.setFirstRunFlowComplete(false);
// Simulate a tap that resolves to show the Bar. // Simulate a tap that resolves to show the Bar.
......
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