Commit 6655ab1a authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Add a command line switch to disable checking if the first run

flow is complete.

When showing the second run promo, Chrome checks if the
first run promo has completed. This CL adds a switch to
disable that check if a command line switch is set.
This switch would be used for UI Automator tests.

Bug: 752972,752973
Change-Id: I345fbc89dd7c51cdca4ddf1203a9e1e29045cab4
Reviewed-on: https://chromium-review.googlesource.com/780264
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521065}
parent 8fabb768
......@@ -31,6 +31,12 @@ public abstract class ChromeSwitches {
/** Disable the First Run Experience. */
public static final String DISABLE_FIRST_RUN_EXPERIENCE = "disable-fre";
/**
* Forces the First Run Experience (FRE) flow complete check to always return true.
*/
public static final String FORCE_FIRST_RUN_FLOW_COMPLETE_FOR_TESTING =
"force-first-run-flow-complete";
/** Force the crash dump to be uploaded regardless of preferences. */
public static final String FORCE_CRASH_DUMP_UPLOAD = "force-dump-upload";
......
......@@ -4,7 +4,9 @@
package org.chromium.chrome.browser.firstrun;
import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
import org.chromium.chrome.browser.ChromeSwitches;
/**
* Gets and sets preferences related to the status of the first run experience.
......@@ -34,8 +36,12 @@ public class FirstRunStatus {
* includes ToS and Sign In pages if necessary.
*/
public static boolean getFirstRunFlowComplete() {
return ContextUtils.getAppSharedPreferences()
.getBoolean(FIRST_RUN_FLOW_COMPLETE, false);
if (ContextUtils.getAppSharedPreferences().getBoolean(FIRST_RUN_FLOW_COMPLETE, false)) {
return true;
}
return CommandLine.isInitialized()
&& CommandLine.getInstance().hasSwitch(
ChromeSwitches.FORCE_FIRST_RUN_FLOW_COMPLETE_FOR_TESTING);
}
/**
......
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