Commit e9559e59 authored by Yue Li's avatar Yue Li Committed by Commit Bot

Tast: Add a new autotest private API

This change adds a new autotest API: isArcPackageListInitialRefreshed,
to check whether the ARC package list has been refreshed.

Bug: 982538
Test: Run the tast testcase added in
Change-Id: I1b9633be08098c9dcb23609fdc0332d09d1f545b
https: //chrome-internal-review.googlesource.com/c/chromeos/platform/tast-tests-private/+/1948653
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1981249Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: Yue Li <updowndota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729710}
parent 0ca2455d
...@@ -2502,6 +2502,27 @@ void AutotestPrivateWaitForAssistantQueryStatusFunction::Timeout() { ...@@ -2502,6 +2502,27 @@ void AutotestPrivateWaitForAssistantQueryStatusFunction::Timeout() {
Respond(Error("No query response received before time out.")); Respond(Error("No query response received before time out."));
} }
///////////////////////////////////////////////////////////////////////////////
// AutotestPrivateIsArcPackageListInitialRefreshedFunction
///////////////////////////////////////////////////////////////////////////////
AutotestPrivateIsArcPackageListInitialRefreshedFunction::
AutotestPrivateIsArcPackageListInitialRefreshedFunction() = default;
AutotestPrivateIsArcPackageListInitialRefreshedFunction::
~AutotestPrivateIsArcPackageListInitialRefreshedFunction() = default;
ExtensionFunction::ResponseAction
AutotestPrivateIsArcPackageListInitialRefreshedFunction::Run() {
DVLOG(1) << "AutotestPrivateIsArcPackageListInitialRefreshedFunction";
ArcAppListPrefs* const prefs =
ArcAppListPrefs::Get(Profile::FromBrowserContext(browser_context()));
return RespondNow(OneArgument(
std::make_unique<base::Value>(prefs->package_list_initial_refreshed())));
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// AutotestPrivateSetWhitelistedPrefFunction // AutotestPrivateSetWhitelistedPrefFunction
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
......
...@@ -643,6 +643,18 @@ class AutotestPrivateWaitForAssistantQueryStatusFunction ...@@ -643,6 +643,18 @@ class AutotestPrivateWaitForAssistantQueryStatusFunction
base::OneShotTimer timeout_timer_; base::OneShotTimer timeout_timer_;
}; };
class AutotestPrivateIsArcPackageListInitialRefreshedFunction
: public ExtensionFunction {
public:
AutotestPrivateIsArcPackageListInitialRefreshedFunction();
DECLARE_EXTENSION_FUNCTION("autotestPrivate.isArcPackageListInitialRefreshed",
AUTOTESTPRIVATE_ISARCPACKAGELISTINITIALREFRESHED)
private:
~AutotestPrivateIsArcPackageListInitialRefreshedFunction() override;
ResponseAction Run() override;
};
// Set user pref value in the pref tree. // Set user pref value in the pref tree.
class AutotestPrivateSetWhitelistedPrefFunction : public ExtensionFunction { class AutotestPrivateSetWhitelistedPrefFunction : public ExtensionFunction {
public: public:
......
...@@ -239,6 +239,8 @@ namespace autotestPrivate { ...@@ -239,6 +239,8 @@ namespace autotestPrivate {
callback IsArcProvisionedCallback = void (boolean arcProvisioned); callback IsArcProvisionedCallback = void (boolean arcProvisioned);
callback IsArcPackageListInitialRefreshedCallback = void (boolean refreshed);
dictionary ArcAppDict { dictionary ArcAppDict {
DOMString name; DOMString name;
DOMString packageName; DOMString packageName;
...@@ -662,6 +664,11 @@ namespace autotestPrivate { ...@@ -662,6 +664,11 @@ namespace autotestPrivate {
long timeout_s, long timeout_s,
AssistantQueryStatusCallback callback); AssistantQueryStatusCallback callback);
// Whether the local list of installed ARC packages has been refreshed for
// the first time after user login.
static void isArcPackageListInitialRefreshed(
IsArcPackageListInitialRefreshedCallback callback);
// Set value for the specified user pref in the pref tree. // Set value for the specified user pref in the pref tree.
static void setWhitelistedPref(DOMString pref_name, any value, static void setWhitelistedPref(DOMString pref_name, any value,
VoidCallback callback); VoidCallback callback);
......
...@@ -1489,6 +1489,7 @@ enum HistogramValue { ...@@ -1489,6 +1489,7 @@ enum HistogramValue {
WEBCAMPRIVATE_SET_HOME = 1426, WEBCAMPRIVATE_SET_HOME = 1426,
INPUTMETHODPRIVATE_RESET = 1427, INPUTMETHODPRIVATE_RESET = 1427,
PRINTING_GETPRINTERINFO = 1428, PRINTING_GETPRINTERINFO = 1428,
AUTOTESTPRIVATE_ISARCPACKAGELISTINITIALREFRESHED = 1429,
// Last entry: Add new entries above, then run: // Last entry: Add new entries above, then run:
// python tools/metrics/histograms/update_extension_histograms.py // python tools/metrics/histograms/update_extension_histograms.py
ENUM_BOUNDARY ENUM_BOUNDARY
......
...@@ -21710,6 +21710,7 @@ to ensure that the crash string is shown properly on the user-facing crash UI. ...@@ -21710,6 +21710,7 @@ to ensure that the crash string is shown properly on the user-facing crash UI.
<int value="1426" label="WEBCAMPRIVATE_SET_HOME"/> <int value="1426" label="WEBCAMPRIVATE_SET_HOME"/>
<int value="1427" label="INPUTMETHODPRIVATE_RESET"/> <int value="1427" label="INPUTMETHODPRIVATE_RESET"/>
<int value="1428" label="PRINTING_GETPRINTERINFO"/> <int value="1428" label="PRINTING_GETPRINTERINFO"/>
<int value="1429" label="AUTOTESTPRIVATE_ISARCPACKAGELISTINITIALREFRESHED"/>
</enum> </enum>
<enum name="ExtensionIconState"> <enum name="ExtensionIconState">
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