Allow arbitrary channels in Android.
Add a new image property allow_arbitrary_channels which is true on
Android and false on Chrome OS.
Bug: 72259103
Test: adb shell update_engine_client --channel=foo-channel
Change-Id: I70a0980fd877ee32d6152595f8d4462bf43254a2
diff --git a/omaha_request_params_unittest.cc b/omaha_request_params_unittest.cc
index 57ecf24..6705c71 100644
--- a/omaha_request_params_unittest.cc
+++ b/omaha_request_params_unittest.cc
@@ -145,6 +145,7 @@
params.set_root(tempdir_.GetPath().value());
SetLockDown(true);
EXPECT_TRUE(params.Init("", "", false));
+ params.image_props_.allow_arbitrary_channels = false;
string error_message;
EXPECT_FALSE(
params.SetTargetChannel("dogfood-channel", true, &error_message));
@@ -167,6 +168,8 @@
EXPECT_FALSE(params_.IsValidChannel("dogfood-channel"));
EXPECT_FALSE(params_.IsValidChannel("some-channel"));
EXPECT_FALSE(params_.IsValidChannel(""));
+ params_.image_props_.allow_arbitrary_channels = true;
+ EXPECT_TRUE(params_.IsValidChannel("some-channel"));
}
TEST_F(OmahaRequestParamsTest, SetTargetChannelWorks) {