Commit 9ecc6042 authored by Bruno Kim Medeiros Cesar's avatar Bruno Kim Medeiros Cesar Committed by Commit Bot

Pipe down child status to upgrade ARC instance request.

Bug: 836246
Change-Id: I6db06e859468e7ab4d19424a91d8a90bffa23a2e
Reviewed-on: https://chromium-review.googlesource.com/1070658
Commit-Queue: Bruno Kim Medeiros Cesar <brunokim@chromium.org>
Reviewed-by: default avatarLuis Hector Chavez <lhchavez@chromium.org>
Reviewed-by: default avatarYury Khmel <khmel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571138}
parent c618b6e7
......@@ -993,12 +993,15 @@ void ArcSessionManager::StartArc() {
demo_session_apps_path = demo_session->GetDemoAppsPath();
}
ArcSession::UpgradeParams params;
params.is_child = profile_->IsChild();
params.locale = locale;
// Empty |preferred_lanaguages| is converted to empty array.
arc_session_runner_->RequestUpgrade(
locale,
base::SplitString(preferred_lanaguages, ",", base::TRIM_WHITESPACE,
base::SPLIT_WANT_ALL),
demo_session_apps_path);
params.preferred_languages = base::SplitString(
preferred_lanaguages, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
params.demo_session_apps_path = demo_session_apps_path;
arc_session_runner_->RequestUpgrade(std::move(params));
}
void ArcSessionManager::StopArc() {
......
......@@ -8,6 +8,13 @@
namespace arc {
ArcSession::UpgradeParams::UpgradeParams() = default;
ArcSession::UpgradeParams::UpgradeParams(ArcSession::UpgradeParams&& other) =
default;
ArcSession::UpgradeParams& ArcSession::UpgradeParams::operator=(
ArcSession::UpgradeParams&& other) = default;
ArcSession::UpgradeParams::~UpgradeParams() = default;
ArcSession::ArcSession() = default;
ArcSession::~ArcSession() = default;
......
......@@ -9,6 +9,7 @@
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/observer_list.h"
#include "components/arc/arc_stop_reason.h"
......@@ -44,6 +45,33 @@ class ArcSession {
virtual ~Observer() = default;
};
// Parameters to upgrade request.
struct UpgradeParams {
// Explicit ctor/dtor declaration is necessary for complex struct. See
// https://cs.chromium.org/chromium/src/tools/clang/plugins/FindBadConstructsConsumer.cpp
UpgradeParams();
~UpgradeParams();
UpgradeParams(UpgradeParams&& other);
UpgradeParams& operator=(UpgradeParams&& other);
// Whether the account is a child.
bool is_child;
// Define language configuration set during Android container boot.
// |preferred_languages| may be empty.
std::string locale;
std::vector<std::string> preferred_languages;
// |demo_session_apps_path| is a file path to the image containing set of
// demo apps that should be added to the Android container for demo
// sessions. It might be empty, in which case no demo apps will be added to
// the container.
base::FilePath demo_session_apps_path;
private:
DISALLOW_COPY_AND_ASSIGN(UpgradeParams);
};
// Creates a default instance of ArcSession.
static std::unique_ptr<ArcSession> Create(
ArcBridgeService* arc_bridge_service);
......@@ -52,18 +80,10 @@ class ArcSession {
// Sends D-Bus message to start a mini-container.
virtual void StartMiniInstance() = 0;
// Sends a D-Bus message to upgrade to a full instance if
// possible. This might be done asynchronously; the message might only be sent
// after other operations have completed. |locale| and |preferred_languages|
// define language configuration set during Android container boot.
// |preferred_languages| may be empty. |demo_session_apps_path| is a file path
// to the image containing set of demo apps that should be added to the
// Android container for demo sessions. It might be empty, in which case no
// demo apps will be added to the container.
virtual void RequestUpgrade(
const std::string& locale,
const std::vector<std::string>& preferred_languages,
const base::FilePath& demo_session_apps_path) = 0;
// Sends a D-Bus message to upgrade to a full instance if possible. This might
// be done asynchronously; the message might only be sent after other
// operations have completed.
virtual void RequestUpgrade(UpgradeParams params) = 0;
// Requests to stop the currently-running instance regardless of its mode.
// The completion is notified via OnSessionStopped() of the Observer.
......
......@@ -271,17 +271,12 @@ void ArcSessionImpl::StartMiniInstance() {
weak_factory_.GetWeakPtr()));
}
void ArcSessionImpl::RequestUpgrade(
const std::string& locale,
const std::vector<std::string>& preferred_languages,
const base::FilePath& demo_session_apps_path) {
void ArcSessionImpl::RequestUpgrade(UpgradeParams params) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(!locale.empty());
DCHECK(!params.locale.empty());
upgrade_requested_ = true;
locale_ = locale;
preferred_languages_ = preferred_languages;
demo_session_apps_path_ = demo_session_apps_path;
upgrade_params_ = std::move(params);
switch (state_) {
case State::NOT_STARTED:
......@@ -371,12 +366,14 @@ void ArcSessionImpl::DoUpgrade() {
<< packages_cache_mode_string << ".";
}
request.set_locale(locale_);
for (const std::string& language : preferred_languages_)
request.set_is_child(upgrade_params_.is_child);
request.set_locale(upgrade_params_.locale);
for (const std::string& language : upgrade_params_.preferred_languages)
request.add_preferred_languages(language);
if (!demo_session_apps_path_.empty())
request.set_demo_session_apps_path(demo_session_apps_path_.value());
if (!upgrade_params_.demo_session_apps_path.empty())
request.set_demo_session_apps_path(
upgrade_params_.demo_session_apps_path.value());
chromeos::SessionManagerClient* client = GetSessionManagerClient();
client->UpgradeArcContainer(
......
......@@ -142,9 +142,7 @@ class ArcSessionImpl : public ArcSession,
// ArcSession overrides:
void StartMiniInstance() override;
void RequestUpgrade(const std::string& locale,
const std::vector<std::string>& preferred_languages,
const base::FilePath& demo_session_apps_path) override;
void RequestUpgrade(UpgradeParams params) override;
void Stop() override;
bool IsStopRequested() override;
void OnShutdown() override;
......@@ -204,13 +202,8 @@ class ArcSessionImpl : public ArcSession,
// to notify cancelling of the procedure.
base::ScopedFD accept_cancel_pipe_;
// Locale and preferred languages to set in Android container during the boot.
std::string locale_;
std::vector<std::string> preferred_languages_;
// Path to squashfs image containing demo apps that should be loaded in the
// container.
base::FilePath demo_session_apps_path_;
// Parameters to upgrade request.
UpgradeParams upgrade_params_;
// Mojo endpoint.
std::unique_ptr<mojom::ArcBridgeHost> arc_bridge_host_;
......
......@@ -32,6 +32,12 @@ constexpr char kFakeGmail[] = "user@gmail.com";
constexpr char kFakeGmailGaiaId[] = "1234567890";
constexpr char kDefaultLocale[] = "en-US";
ArcSession::UpgradeParams DefaultUpgradeParams() {
ArcSession::UpgradeParams params;
params.locale = kDefaultLocale;
return params;
}
class FakeDelegate : public ArcSessionImpl::Delegate {
public:
FakeDelegate() = default;
......@@ -237,8 +243,7 @@ TEST_F(ArcSessionImplTest, Upgrade_LowDisk) {
TestArcSessionObserver observer(arc_session.get(), &run_loop);
ASSERT_NO_FATAL_FAILURE(SetupMiniContainer(arc_session.get(), &observer));
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
run_loop.Run();
EXPECT_EQ(ArcSessionImpl::State::STOPPED, arc_session->GetStateForTesting());
......@@ -257,8 +262,7 @@ TEST_F(ArcSessionImplTest, Upgrade_Success) {
ASSERT_NO_FATAL_FAILURE(SetupMiniContainer(arc_session.get(), &observer));
// Then, upgrade to a full instance.
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
base::RunLoop().RunUntilIdle();
EXPECT_EQ(ArcSessionImpl::State::RUNNING_FULL_INSTANCE,
......@@ -278,8 +282,7 @@ TEST_F(ArcSessionImplTest, Upgrade_DBusFail) {
EmulateDBusFailure();
// Then upgrade, which should fail.
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
base::RunLoop().RunUntilIdle();
EXPECT_EQ(ArcSessionImpl::State::STOPPED, arc_session->GetStateForTesting());
......@@ -304,8 +307,7 @@ TEST_F(ArcSessionImplTest, Upgrade_MojoConnectionFail) {
ASSERT_NO_FATAL_FAILURE(SetupMiniContainer(arc_session.get(), &observer));
// Upgrade should fail, due to Mojo connection fail set above.
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
base::RunLoop().RunUntilIdle();
EXPECT_EQ(ArcSessionImpl::State::STOPPED, arc_session->GetStateForTesting());
......@@ -326,8 +328,7 @@ TEST_F(ArcSessionImplTest, Upgrade_StartingMiniInstance) {
arc_session->GetStateForTesting());
// Before moving forward to RUNNING_MINI_INSTANCE, start upgrading it.
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
// The state should not immediately switch to STARTING_FULL_INSTANCE, yet.
EXPECT_EQ(ArcSessionImpl::State::STARTING_MINI_INSTANCE,
......@@ -388,8 +389,7 @@ TEST_F(ArcSessionImplTest, Stop_StartingFullInstanceForUpgrade) {
ASSERT_NO_FATAL_FAILURE(SetupMiniContainer(arc_session.get(), &observer));
// Then upgrade.
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
ASSERT_EQ(ArcSessionImpl::State::STARTING_FULL_INSTANCE,
arc_session->GetStateForTesting());
......@@ -417,8 +417,7 @@ TEST_F(ArcSessionImplTest, Stop_ConnectingMojoForUpgrade) {
ASSERT_NO_FATAL_FAILURE(SetupMiniContainer(arc_session.get(), &observer));
// Then upgrade. This should suspend at Mojo connection.
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
base::RunLoop().RunUntilIdle();
ASSERT_EQ(ArcSessionImpl::State::CONNECTING_MOJO,
arc_session->GetStateForTesting());
......@@ -444,8 +443,7 @@ TEST_F(ArcSessionImplTest, Stop_RunningFullInstanceForUpgrade) {
ASSERT_NO_FATAL_FAILURE(SetupMiniContainer(arc_session.get(), &observer));
// And upgrade successfully.
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
base::RunLoop().RunUntilIdle();
ASSERT_EQ(ArcSessionImpl::State::RUNNING_FULL_INSTANCE,
arc_session->GetStateForTesting());
......@@ -472,8 +470,7 @@ TEST_F(ArcSessionImplTest,
arc_session->GetStateForTesting());
// Request to upgrade during starting mini container.
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
// Then, the state should stay at STARTING_MINI_INSTANCE.
ASSERT_EQ(ArcSessionImpl::State::STARTING_MINI_INSTANCE,
arc_session->GetStateForTesting());
......@@ -522,8 +519,7 @@ TEST_F(ArcSessionImplTest, ArcStopInstance) {
auto arc_session = CreateArcSession();
TestArcSessionObserver observer(arc_session.get());
arc_session->StartMiniInstance();
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
base::RunLoop().RunUntilIdle();
ASSERT_EQ(ArcSessionImpl::State::RUNNING_FULL_INSTANCE,
arc_session->GetStateForTesting());
......@@ -547,8 +543,7 @@ TEST_F(ArcSessionImplTest, ArcStopInstance) {
TEST_F(ArcSessionImplTest, ArcStopInstance_WrongContainerInstanceId) {
auto arc_session = CreateArcSession();
arc_session->StartMiniInstance();
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
base::RunLoop().RunUntilIdle();
ASSERT_EQ(ArcSessionImpl::State::RUNNING_FULL_INSTANCE,
arc_session->GetStateForTesting());
......@@ -604,8 +599,7 @@ TEST_P(ArcSessionImplPackagesCacheModeTest, PackagesCacheModes) {
arc_session->StartMiniInstance();
if (state.full_container)
arc_session->RequestUpgrade(kDefaultLocale, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path */);
arc_session->RequestUpgrade(DefaultUpgradeParams());
base::RunLoop().RunUntilIdle();
EXPECT_EQ(state.expected_packages_cache_mode, GetSessionManagerClient()
->last_upgrade_arc_request()
......@@ -616,5 +610,18 @@ INSTANTIATE_TEST_CASE_P(,
ArcSessionImplPackagesCacheModeTest,
::testing::ValuesIn(kPackagesCacheModeStates));
TEST_F(ArcSessionImplTest, IsChild) {
auto arc_session = CreateArcSession();
arc_session->StartMiniInstance();
ArcSession::UpgradeParams params;
params.is_child = true;
params.locale = kDefaultLocale;
arc_session->RequestUpgrade(std::move(params));
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(GetSessionManagerClient()->last_upgrade_arc_request().is_child());
}
} // namespace
} // namespace arc
......@@ -141,14 +141,8 @@ void ArcSessionRunner::RequestStartMiniInstance() {
RequestStart(ArcInstanceMode::MINI_INSTANCE);
}
void ArcSessionRunner::RequestUpgrade(
const std::string& locale,
const std::vector<std::string>& preferred_languages,
const base::FilePath& demo_session_apps_path) {
locale_ = locale;
preferred_languages_ = preferred_languages;
demo_session_apps_path_ = demo_session_apps_path;
void ArcSessionRunner::RequestUpgrade(ArcSession::UpgradeParams params) {
upgrade_params_ = std::move(params);
RequestStart(ArcInstanceMode::FULL_INSTANCE);
}
......@@ -248,8 +242,7 @@ void ArcSessionRunner::StartArcSession() {
RecordInstanceCrashUma(ArcContainerLifetimeEvent::CONTAINER_STARTING);
}
if (target_mode_ == ArcInstanceMode::FULL_INSTANCE) {
arc_session_->RequestUpgrade(locale_, preferred_languages_,
demo_session_apps_path_);
arc_session_->RequestUpgrade(std::move(upgrade_params_));
}
}
......
......@@ -81,9 +81,7 @@ class ArcSessionRunner : public ArcSession::Observer {
// Starts the full ARC instance, then it will connect the Mojo channel. When
// the bridge becomes ready, registered Observer's OnSessionReady() is called.
void RequestUpgrade(const std::string& locale,
const std::vector<std::string>& preferred_languages,
const base::FilePath& demo_session_apps_path);
void RequestUpgrade(ArcSession::UpgradeParams params);
// Stops the ARC service.
void RequestStop();
......@@ -138,13 +136,8 @@ class ArcSessionRunner : public ArcSession::Observer {
// nullptr if the state is STOPPED, otherwise non-nullptr.
std::unique_ptr<ArcSession> arc_session_;
// Locale and preferred languages to set in Android container during the boot.
std::string locale_;
std::vector<std::string> preferred_languages_;
// Path to demo session apps image that should be loaded in Android container
// during the boot for demo sessions.
base::FilePath demo_session_apps_path_;
// Parameters to upgrade request.
ArcSession::UpgradeParams upgrade_params_;
// WeakPtrFactory to use callbacks.
base::WeakPtrFactory<ArcSessionRunner> weak_ptr_factory_;
......
......@@ -35,6 +35,12 @@ constexpr int kContainerCrashedEarly =
constexpr int kContainerCrashed =
static_cast<int>(ArcContainerLifetimeEvent::CONTAINER_CRASHED);
ArcSession::UpgradeParams DefaultUpgradeParams() {
ArcSession::UpgradeParams params;
params.locale = "en-US";
return params;
}
class DoNothingObserver : public ArcSessionRunner::Observer {
public:
void OnSessionStopped(ArcStopReason reason, bool restarting) override {
......@@ -170,9 +176,7 @@ TEST_F(ArcSessionRunnerTest, Basic) {
EXPECT_FALSE(arc_session());
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
ASSERT_TRUE(arc_session());
EXPECT_TRUE(arc_session()->is_running());
......@@ -188,9 +192,7 @@ TEST_F(ArcSessionRunnerTest, StopMidStartup) {
base::Bind(&ArcSessionRunnerTest::CreateSuspendedArcSession));
EXPECT_FALSE(arc_session());
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
ASSERT_TRUE(arc_session());
EXPECT_FALSE(arc_session()->is_running());
......@@ -221,9 +223,7 @@ TEST_F(ArcSessionRunnerTest, BootFailure) {
ArcStopReason::GENERIC_BOOT_FAILURE));
EXPECT_FALSE(arc_session());
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
EXPECT_EQ(ArcStopReason::GENERIC_BOOT_FAILURE, stop_reason());
EXPECT_FALSE(arc_session());
EXPECT_FALSE(restarting());
......@@ -243,12 +243,10 @@ TEST_F(ArcSessionRunnerTest, BootFailure_MiniInstance) {
EXPECT_FALSE(arc_session());
EXPECT_FALSE(stopped_called());
// Also make sure that RequestStart() works just fine after the boot
// Also make sure that RequestUpgrade() works just fine after the boot
// failure.
ResetArcSessionFactory(base::Bind(FakeArcSession::Create));
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
ASSERT_TRUE(arc_session());
EXPECT_TRUE(arc_session()->is_running());
}
......@@ -269,8 +267,7 @@ TEST_F(ArcSessionRunnerTest, Crash_MiniInstance) {
EXPECT_FALSE(stopped_called());
}
// Tests that RequestStart(FULL_INSTANCE) works after calling
// RequestStart(MINI_INSTANCE).
// Tests that RequestUpgrade works after calling RequestStart.
TEST_F(ArcSessionRunnerTest, Upgrade) {
EXPECT_FALSE(arc_session());
......@@ -278,9 +275,7 @@ TEST_F(ArcSessionRunnerTest, Upgrade) {
ASSERT_TRUE(arc_session());
EXPECT_FALSE(arc_session()->is_running());
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
ASSERT_TRUE(arc_session());
EXPECT_TRUE(arc_session()->is_running());
}
......@@ -290,9 +285,7 @@ TEST_F(ArcSessionRunnerTest, Restart) {
arc_session_runner()->SetRestartDelayForTesting(base::TimeDelta());
EXPECT_FALSE(arc_session());
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
ASSERT_TRUE(arc_session());
EXPECT_TRUE(arc_session()->is_running());
......@@ -314,9 +307,7 @@ TEST_F(ArcSessionRunnerTest, GracefulStop) {
arc_session_runner()->SetRestartDelayForTesting(base::TimeDelta());
EXPECT_FALSE(arc_session());
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
ASSERT_TRUE(arc_session());
EXPECT_TRUE(arc_session()->is_running());
......@@ -332,9 +323,7 @@ TEST_F(ArcSessionRunnerTest, Shutdown) {
arc_session_runner()->SetRestartDelayForTesting(base::TimeDelta());
EXPECT_FALSE(arc_session());
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
ASSERT_TRUE(arc_session());
EXPECT_TRUE(arc_session()->is_running());
......@@ -372,9 +361,7 @@ TEST_F(ArcSessionRunnerTest, UmaRecording_StartUpgradeShutdown) {
1 /* count of the sample */);
// Boot continue should not increase the count.
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
tester.ExpectUniqueSample("Arc.ContainerLifetimeEvent", kContainerStarting,
1);
......@@ -388,9 +375,7 @@ TEST_F(ArcSessionRunnerTest, UmaRecording_StartUpgradeShutdown) {
TEST_F(ArcSessionRunnerTest, UmaRecording_StartShutdown) {
base::HistogramTester tester;
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
tester.ExpectUniqueSample("Arc.ContainerLifetimeEvent", kContainerStarting,
1);
// "0" should be recorded as a restart count on shutdown.
......@@ -409,9 +394,7 @@ TEST_F(ArcSessionRunnerTest, UmaRecording_CrashTwice) {
arc_session_runner()->RequestStartMiniInstance();
tester.ExpectUniqueSample("Arc.ContainerLifetimeEvent", kContainerStarting,
1);
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
// Stop the instance with CRASH.
arc_session()->StopWithReason(ArcStopReason::CRASH);
......@@ -472,9 +455,7 @@ TEST_F(ArcSessionRunnerTest, UmaRecording_BootFail) {
TEST_F(ArcSessionRunnerTest, UmaRecording_LowDisk) {
base::HistogramTester tester;
arc_session_runner()->RequestUpgrade(
std::string() /* locale */, {} /* preferred_languages */,
base::FilePath() /* demo_session_apps_path*/);
arc_session_runner()->RequestUpgrade(DefaultUpgradeParams());
tester.ExpectUniqueSample("Arc.ContainerLifetimeEvent", kContainerStarting,
1);
......
......@@ -16,10 +16,7 @@ FakeArcSession::~FakeArcSession() = default;
void FakeArcSession::StartMiniInstance() {}
void FakeArcSession::RequestUpgrade(
const std::string& locale,
const std::vector<std::string>& preferred_languages,
const base::FilePath& demo_session_apps_path) {
void FakeArcSession::RequestUpgrade(UpgradeParams params) {
upgrade_requested_ = true;
if (boot_failure_emulation_enabled_) {
for (auto& observer : observer_list_)
......
......@@ -21,9 +21,7 @@ class FakeArcSession : public ArcSession {
// ArcSession overrides:
void StartMiniInstance() override;
void RequestUpgrade(const std::string& locale,
const std::vector<std::string>& preferred_languages,
const base::FilePath& demo_session_apps_path) override;
void RequestUpgrade(UpgradeParams params) override;
void Stop() override;
bool IsStopRequested() override;
void OnShutdown() override;
......
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