Commit 5afa6055 authored by Yusuke Sato's avatar Yusuke Sato Committed by Commit Bot

arc: Add two more unit tests for ADB sideloading for ARCVM

BUG=None
TEST=components_unittests

Change-Id: I19b8e34eb35d33f768ee2e7ad8b3a01f8d11da08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2559693Reviewed-by: default avatarYury Khmel <khmel@chromium.org>
Commit-Queue: Yusuke Sato <yusukes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831130}
parent 67d941ce
...@@ -841,6 +841,46 @@ TEST_F(ArcVmClientAdapterTest, UpgradeArc_NoValidAdbResponse) { ...@@ -841,6 +841,46 @@ TEST_F(ArcVmClientAdapterTest, UpgradeArc_NoValidAdbResponse) {
EXPECT_TRUE(arc_instance_stopped_called()); EXPECT_TRUE(arc_instance_stopped_called());
} }
// Tests that adb sideloading is disabled by default.
TEST_F(ArcVmClientAdapterTest, UpgradeArc_AdbSideloadingPropertyDefault) {
SetValidUserInfo();
StartMiniArc();
UpgradeArc(true);
EXPECT_TRUE(GetTestConciergeClient()->start_arc_vm_called());
EXPECT_FALSE(arc_instance_stopped_called());
EXPECT_TRUE(
base::Contains(GetTestConciergeClient()->start_arc_vm_request().params(),
"androidboot.enable_adb_sideloading=0"));
}
// Tests that adb sideloading can be controlled via session_manager.
TEST_F(ArcVmClientAdapterTest, UpgradeArc_AdbSideloadingPropertyEnabled) {
SetValidUserInfo();
StartMiniArc();
chromeos::FakeSessionManagerClient::Get()->set_adb_sideload_enabled(true);
UpgradeArc(true);
EXPECT_TRUE(GetTestConciergeClient()->start_arc_vm_called());
EXPECT_FALSE(arc_instance_stopped_called());
EXPECT_TRUE(
base::Contains(GetTestConciergeClient()->start_arc_vm_request().params(),
"androidboot.enable_adb_sideloading=1"));
}
TEST_F(ArcVmClientAdapterTest, UpgradeArc_AdbSideloadingPropertyDisabled) {
SetValidUserInfo();
StartMiniArc();
chromeos::FakeSessionManagerClient::Get()->set_adb_sideload_enabled(false);
UpgradeArc(true);
EXPECT_TRUE(GetTestConciergeClient()->start_arc_vm_called());
EXPECT_FALSE(arc_instance_stopped_called());
EXPECT_TRUE(
base::Contains(GetTestConciergeClient()->start_arc_vm_request().params(),
"androidboot.enable_adb_sideloading=0"));
}
// Tests that "no serial" failure is handled properly. // Tests that "no serial" failure is handled properly.
TEST_F(ArcVmClientAdapterTest, UpgradeArc_NoSerial) { TEST_F(ArcVmClientAdapterTest, UpgradeArc_NoSerial) {
// Don't set the serial number. Note that we cannot call StartArcVm() without // Don't set the serial number. Note that we cannot call StartArcVm() without
......
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