Commit f111706b authored by Yusuke Sato's avatar Yusuke Sato Committed by Chromium LUCI CQ

arc: Use ScopedChromeOSVersionInfo in arc_vm_client_adapter_unittest.cc

This is a follow-up CL for
https://chromium-review.googlesource.com/c/chromium/src/+/2559533

BUG=None
TEST=try

Change-Id: I8b0624083dfd94110ede99b4f79ed0011d832727
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561048Reviewed-by: default avatarWillie Koomson <wvk@google.com>
Commit-Queue: Yusuke Sato <yusukes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832515}
parent 1c583b53
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/system/sys_info.h"
#include "base/task/current_thread.h" #include "base/task/current_thread.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/test/bind.h" #include "base/test/bind.h"
#include "base/test/scoped_chromeos_version_info.h"
#include "base/test/scoped_run_loop_timeout.h" #include "base/test/scoped_run_loop_timeout.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/cryptohome/cryptohome_parameters.h"
...@@ -1189,7 +1189,7 @@ TEST_F(ArcVmClientAdapterTest, TestCreateArcVmClientAdapter) { ...@@ -1189,7 +1189,7 @@ TEST_F(ArcVmClientAdapterTest, TestCreateArcVmClientAdapter) {
} }
TEST_F(ArcVmClientAdapterTest, ChromeOsChannelStable) { TEST_F(ArcVmClientAdapterTest, ChromeOsChannelStable) {
base::SysInfo::SetChromeOSVersionInfoForTest( base::test::ScopedChromeOSVersionInfo info(
"CHROMEOS_RELEASE_TRACK=stable-channel", base::Time::Now()); "CHROMEOS_RELEASE_TRACK=stable-channel", base::Time::Now());
StartParams start_params(GetPopulatedStartParams()); StartParams start_params(GetPopulatedStartParams());
...@@ -1199,13 +1199,11 @@ TEST_F(ArcVmClientAdapterTest, ChromeOsChannelStable) { ...@@ -1199,13 +1199,11 @@ TEST_F(ArcVmClientAdapterTest, ChromeOsChannelStable) {
EXPECT_TRUE( EXPECT_TRUE(
base::Contains(GetTestConciergeClient()->start_arc_vm_request().params(), base::Contains(GetTestConciergeClient()->start_arc_vm_request().params(),
"androidboot.chromeos_channel=stable")); "androidboot.chromeos_channel=stable"));
base::SysInfo::ResetChromeOSVersionInfoForTest();
} }
TEST_F(ArcVmClientAdapterTest, ChromeOsChannelUnknown) { TEST_F(ArcVmClientAdapterTest, ChromeOsChannelUnknown) {
base::SysInfo::SetChromeOSVersionInfoForTest("CHROMEOS_RELEASE_TRACK=invalid", base::test::ScopedChromeOSVersionInfo info("CHROMEOS_RELEASE_TRACK=invalid",
base::Time::Now()); base::Time::Now());
StartParams start_params(GetPopulatedStartParams()); StartParams start_params(GetPopulatedStartParams());
SetValidUserInfo(); SetValidUserInfo();
...@@ -1214,8 +1212,6 @@ TEST_F(ArcVmClientAdapterTest, ChromeOsChannelUnknown) { ...@@ -1214,8 +1212,6 @@ TEST_F(ArcVmClientAdapterTest, ChromeOsChannelUnknown) {
EXPECT_TRUE( EXPECT_TRUE(
base::Contains(GetTestConciergeClient()->start_arc_vm_request().params(), base::Contains(GetTestConciergeClient()->start_arc_vm_request().params(),
"androidboot.chromeos_channel=unknown")); "androidboot.chromeos_channel=unknown"));
base::SysInfo::ResetChromeOSVersionInfoForTest();
} }
// Tests that the binary translation type is set to None when no library is // Tests that the binary translation type is set to None when no library is
......
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