Commit 35ef02fb authored by Sanja Perisic's avatar Sanja Perisic Committed by Chromium LUCI CQ

Improve the enum naming style in KioskLaunchController class

Improve the enumerator style to match constants, not macros (from ENUM_NAME to kEnumName) according to the Google C++ Style Guide.

Bug: 1157058
Change-Id: I6dda26e324917fdfd27e26523f8c30a41746c251
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2584975Reviewed-by: default avatarAnqing Zhao <anqing@chromium.org>
Commit-Queue: Sanja Perisic <sanjaperisic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836127}
parent dacd7b14
...@@ -211,16 +211,16 @@ void KioskLaunchController::OnProfileLoaded(Profile* profile) { ...@@ -211,16 +211,16 @@ void KioskLaunchController::OnProfileLoaded(Profile* profile) {
} }
app_launcher_->Initialize(); app_launcher_->Initialize();
if (network_ui_state_ == NetworkUIState::NEED_TO_SHOW) if (network_ui_state_ == NetworkUIState::kNeedToShow)
ShowNetworkConfigureUI(); ShowNetworkConfigureUI();
} }
void KioskLaunchController::OnConfigureNetwork() { void KioskLaunchController::OnConfigureNetwork() {
DCHECK(profile_); DCHECK(profile_);
if (network_ui_state_ == NetworkUIState::SHOWING) if (network_ui_state_ == NetworkUIState::kShowing)
return; return;
network_ui_state_ = NetworkUIState::SHOWING; network_ui_state_ = NetworkUIState::kShowing;
if (CanConfigureNetwork() && NeedOwnerAuthToConfigureNetwork()) { if (CanConfigureNetwork() && NeedOwnerAuthToConfigureNetwork()) {
host_->VerifyOwnerForKiosk( host_->VerifyOwnerForKiosk(
base::BindOnce(&KioskLaunchController::OnOwnerSigninSuccess, base::BindOnce(&KioskLaunchController::OnOwnerSigninSuccess,
...@@ -296,9 +296,9 @@ void KioskLaunchController::CleanUp() { ...@@ -296,9 +296,9 @@ void KioskLaunchController::CleanUp() {
} }
void KioskLaunchController::OnTimerFire() { void KioskLaunchController::OnTimerFire() {
if (app_state_ == AppState::LAUNCHED) { if (app_state_ == AppState::kLaunched) {
CloseSplashScreen(); CloseSplashScreen();
} else if (app_state_ == AppState::INSTALLED) { } else if (app_state_ == AppState::kInstalled) {
LaunchApp(); LaunchApp();
} else { } else {
launch_on_install_ = true; launch_on_install_ = true;
...@@ -311,7 +311,7 @@ void KioskLaunchController::CloseSplashScreen() { ...@@ -311,7 +311,7 @@ void KioskLaunchController::CloseSplashScreen() {
void KioskLaunchController::OnAppInstalling() { void KioskLaunchController::OnAppInstalling() {
SYSLOG(INFO) << "Kiosk app started installing."; SYSLOG(INFO) << "Kiosk app started installing.";
app_state_ = AppState::INSTALLING_APP; app_state_ = AppState::kInstallingApp;
if (!splash_screen_view_) if (!splash_screen_view_)
return; return;
splash_screen_view_->UpdateAppLaunchState( splash_screen_view_->UpdateAppLaunchState(
...@@ -327,10 +327,10 @@ void KioskLaunchController::OnAppPrepared() { ...@@ -327,10 +327,10 @@ void KioskLaunchController::OnAppPrepared() {
if (!splash_screen_view_) if (!splash_screen_view_)
return; return;
if (network_ui_state_ != NetworkUIState::NOT_SHOWING) if (network_ui_state_ != NetworkUIState::kNotShowing)
return; return;
app_state_ = AppState::INSTALLING_EXTENSIONS; app_state_ = AppState::kInstallingExtensions;
extensions::ForceInstalledTracker* tracker = extensions::ForceInstalledTracker* tracker =
GetForceInstalledTracker(profile_); GetForceInstalledTracker(profile_);
...@@ -363,14 +363,14 @@ void KioskLaunchController::InitializeNetwork() { ...@@ -363,14 +363,14 @@ void KioskLaunchController::InitializeNetwork() {
splash_screen_view_->UpdateAppLaunchState( splash_screen_view_->UpdateAppLaunchState(
AppLaunchSplashScreenView::APP_LAUNCH_STATE_PREPARING_NETWORK); AppLaunchSplashScreenView::APP_LAUNCH_STATE_PREPARING_NETWORK);
app_state_ = AppState::INIT_NETWORK; app_state_ = AppState::kInitNetwork;
if (splash_screen_view_->IsNetworkReady()) if (splash_screen_view_->IsNetworkReady())
OnNetworkStateChanged(true); OnNetworkStateChanged(true);
} }
void KioskLaunchController::OnNetworkWaitTimedOut() { void KioskLaunchController::OnNetworkWaitTimedOut() {
DCHECK_EQ(network_ui_state_, NetworkUIState::NOT_SHOWING); DCHECK_EQ(network_ui_state_, NetworkUIState::kNotShowing);
auto connection_type = network::mojom::ConnectionType::CONNECTION_UNKNOWN; auto connection_type = network::mojom::ConnectionType::CONNECTION_UNKNOWN;
content::GetNetworkConnectionTracker()->GetConnectionType(&connection_type, content::GetNetworkConnectionTracker()->GetConnectionType(&connection_type,
...@@ -399,7 +399,7 @@ bool KioskLaunchController::IsNetworkReady() const { ...@@ -399,7 +399,7 @@ bool KioskLaunchController::IsNetworkReady() const {
} }
bool KioskLaunchController::IsShowingNetworkConfigScreen() const { bool KioskLaunchController::IsShowingNetworkConfigScreen() const {
return network_ui_state_ == NetworkUIState::SHOWING; return network_ui_state_ == NetworkUIState::kShowing;
} }
bool KioskLaunchController::ShouldSkipAppInstallation() const { bool KioskLaunchController::ShouldSkipAppInstallation() const {
...@@ -437,7 +437,7 @@ void KioskLaunchController::HandleWebAppInstallFailed() { ...@@ -437,7 +437,7 @@ void KioskLaunchController::HandleWebAppInstallFailed() {
// there is a third-party authorization which causes redirect to url that // there is a third-party authorization which causes redirect to url that
// differs from the install url. We should proceed with launch in such cases, // differs from the install url. We should proceed with launch in such cases,
// expecting this situation to not happen upon next launch. // expecting this situation to not happen upon next launch.
app_state_ = AppState::INSTALLED; app_state_ = AppState::kInstalled;
SYSLOG(WARNING) << "Failed to obtain app data, trying to launch anyway.."; SYSLOG(WARNING) << "Failed to obtain app data, trying to launch anyway..";
...@@ -453,7 +453,7 @@ void KioskLaunchController::HandleWebAppInstallFailed() { ...@@ -453,7 +453,7 @@ void KioskLaunchController::HandleWebAppInstallFailed() {
void KioskLaunchController::OnAppLaunched() { void KioskLaunchController::OnAppLaunched() {
SYSLOG(INFO) << "Kiosk launch succeeded, wait for app window."; SYSLOG(INFO) << "Kiosk launch succeeded, wait for app window.";
app_state_ = AppState::LAUNCHED; app_state_ = AppState::kLaunched;
if (splash_screen_view_) { if (splash_screen_view_) {
splash_screen_view_->UpdateAppLaunchState( splash_screen_view_->UpdateAppLaunchState(
AppLaunchSplashScreenView::APP_LAUNCH_STATE_WAITING_APP_WINDOW); AppLaunchSplashScreenView::APP_LAUNCH_STATE_WAITING_APP_WINDOW);
...@@ -498,7 +498,7 @@ void KioskLaunchController::OnOldEncryptionDetected( ...@@ -498,7 +498,7 @@ void KioskLaunchController::OnOldEncryptionDetected(
} }
void KioskLaunchController::OnForceInstalledExtensionsReady() { void KioskLaunchController::OnForceInstalledExtensionsReady() {
app_state_ = AppState::INSTALLED; app_state_ = AppState::kInstalled;
extensions::ForceInstalledTracker* tracker = extensions::ForceInstalledTracker* tracker =
GetForceInstalledTracker(profile_); GetForceInstalledTracker(profile_);
if (tracker) if (tracker)
...@@ -575,53 +575,53 @@ void KioskLaunchController::ShowNetworkConfigureUI() { ...@@ -575,53 +575,53 @@ void KioskLaunchController::ShowNetworkConfigureUI() {
splash_wait_timer_.Stop(); splash_wait_timer_.Stop();
network_wait_timer_.Stop(); network_wait_timer_.Stop();
launch_on_install_ = true; launch_on_install_ = true;
network_ui_state_ = NetworkUIState::SHOWING; network_ui_state_ = NetworkUIState::kShowing;
splash_screen_view_->ShowNetworkConfigureUI(); splash_screen_view_->ShowNetworkConfigureUI();
} }
void KioskLaunchController::CloseNetworkConfigureScreenIfOnline() { void KioskLaunchController::CloseNetworkConfigureScreenIfOnline() {
if (network_ui_state_ == NetworkUIState::SHOWING && network_wait_timedout_) { if (network_ui_state_ == NetworkUIState::kShowing && network_wait_timedout_) {
SYSLOG(INFO) << "We are back online, closing network configure screen."; SYSLOG(INFO) << "We are back online, closing network configure screen.";
splash_screen_view_->ToggleNetworkConfig(false); splash_screen_view_->ToggleNetworkConfig(false);
network_ui_state_ = NetworkUIState::NOT_SHOWING; network_ui_state_ = NetworkUIState::kNotShowing;
} }
} }
void KioskLaunchController::OnNetworkConfigRequested() { void KioskLaunchController::OnNetworkConfigRequested() {
network_ui_state_ = NetworkUIState::NEED_TO_SHOW; network_ui_state_ = NetworkUIState::kNeedToShow;
switch (app_state_) { switch (app_state_) {
case AppState::CREATING_PROFILE: case AppState::kCreatingProfile:
case AppState::INIT_NETWORK: case AppState::kInitNetwork:
case AppState::INSTALLED: case AppState::kInstalled:
MaybeShowNetworkConfigureUI(); MaybeShowNetworkConfigureUI();
break; break;
case AppState::INSTALLING_APP: case AppState::kInstallingApp:
case AppState::INSTALLING_EXTENSIONS: case AppState::kInstallingExtensions:
// When requesting to show network configure UI, we should cancel current // When requesting to show network configure UI, we should cancel current
// installation and restart it as soon as the network is configured. // installation and restart it as soon as the network is configured.
app_state_ = AppState::INIT_NETWORK; app_state_ = AppState::kInitNetwork;
app_launcher_->RestartLauncher(); app_launcher_->RestartLauncher();
MaybeShowNetworkConfigureUI(); MaybeShowNetworkConfigureUI();
break; break;
case AppState::LAUNCHED: case AppState::kLaunched:
// We do nothing since the splash screen is soon to be destroyed. // We do nothing since the splash screen is soon to be destroyed.
break; break;
} }
} }
void KioskLaunchController::OnNetworkConfigFinished() { void KioskLaunchController::OnNetworkConfigFinished() {
network_ui_state_ = NetworkUIState::NOT_SHOWING; network_ui_state_ = NetworkUIState::kNotShowing;
splash_screen_view_->UpdateAppLaunchState( splash_screen_view_->UpdateAppLaunchState(
AppLaunchSplashScreenView::APP_LAUNCH_STATE_PREPARING_PROFILE); AppLaunchSplashScreenView::APP_LAUNCH_STATE_PREPARING_PROFILE);
app_state_ = AppState::INIT_NETWORK; app_state_ = AppState::kInitNetwork;
app_launcher_->RestartLauncher(); app_launcher_->RestartLauncher();
} }
void KioskLaunchController::OnNetworkStateChanged(bool online) { void KioskLaunchController::OnNetworkStateChanged(bool online) {
if (app_state_ == AppState::INIT_NETWORK && online) { if (app_state_ == AppState::kInitNetwork && online) {
// If the network timed out, we should exit network config dialog as soon as // If the network timed out, we should exit network config dialog as soon as
// we are back online. // we are back online.
if (network_ui_state_ == NetworkUIState::NOT_SHOWING || if (network_ui_state_ == NetworkUIState::kNotShowing ||
network_wait_timedout_) { network_wait_timedout_) {
network_wait_timer_.Stop(); network_wait_timer_.Stop();
CloseNetworkConfigureScreenIfOnline(); CloseNetworkConfigureScreenIfOnline();
...@@ -629,8 +629,8 @@ void KioskLaunchController::OnNetworkStateChanged(bool online) { ...@@ -629,8 +629,8 @@ void KioskLaunchController::OnNetworkStateChanged(bool online) {
} }
} }
if ((app_state_ == AppState::INSTALLING_APP || if ((app_state_ == AppState::kInstallingApp ||
app_state_ == AppState::INSTALLING_EXTENSIONS) && app_state_ == AppState::kInstallingExtensions) &&
network_required_ && !online) { network_required_ && !online) {
SYSLOG(WARNING) SYSLOG(WARNING)
<< "Connection lost during installation, restarting launcher."; << "Connection lost during installation, restarting launcher.";
...@@ -642,7 +642,7 @@ void KioskLaunchController::LaunchApp() { ...@@ -642,7 +642,7 @@ void KioskLaunchController::LaunchApp() {
if (g_block_app_launch_for_testing) if (g_block_app_launch_for_testing)
return; return;
DCHECK(app_state_ == AppState::INSTALLED); DCHECK(app_state_ == AppState::kInstalled);
// We need to change the session state so we are able to create browser // We need to change the session state so we are able to create browser
// windows. // windows.
session_manager::SessionManager::Get()->SetSessionState( session_manager::SessionManager::Get()->SetSessionState(
......
...@@ -85,11 +85,11 @@ class KioskLaunchController ...@@ -85,11 +85,11 @@ class KioskLaunchController
std::unique_ptr<KioskAppLauncher> app_launcher); std::unique_ptr<KioskAppLauncher> app_launcher);
bool waiting_for_network() const { bool waiting_for_network() const {
return app_state_ == AppState::INIT_NETWORK; return app_state_ == AppState::kInitNetwork;
} }
bool network_wait_timedout() const { return network_wait_timedout_; } bool network_wait_timedout() const { return network_wait_timedout_; }
bool showing_network_dialog() const { bool showing_network_dialog() const {
return network_ui_state_ == NetworkUIState::SHOWING; return network_ui_state_ == NetworkUIState::kShowing;
} }
void Start(const KioskAppId& kiosk_app_id, bool auto_launch); void Start(const KioskAppId& kiosk_app_id, bool auto_launch);
...@@ -98,19 +98,19 @@ class KioskLaunchController ...@@ -98,19 +98,19 @@ class KioskLaunchController
friend class KioskLaunchControllerTest; friend class KioskLaunchControllerTest;
enum AppState { enum AppState {
CREATING_PROFILE, // Profile is being created. kCreatingProfile = 0, // Profile is being created.
INIT_NETWORK, // Waiting for the network to initialize. kInitNetwork, // Waiting for the network to initialize.
INSTALLING_APP, // App is being installed. kInstallingApp, // App is being installed.
INSTALLING_EXTENSIONS, // Force-installed extensions are being installed. kInstallingExtensions, // Force-installed extensions are being installed.
INSTALLED, // Everything is installed, waiting for the splash screen timer kInstalled, // Everything is installed, waiting for the splash screen timer
// to fire. // to fire.
LAUNCHED // App is being launched. kLaunched // App is being launched.
}; };
enum NetworkUIState { enum NetworkUIState {
NOT_SHOWING, // Network configure UI is not being shown. kNotShowing = 0, // Network configure UI is not being shown.
NEED_TO_SHOW, // We need to show the UI as soon as we can. kNeedToShow, // We need to show the UI as soon as we can.
SHOWING // Network configure UI is being shown. kShowing // Network configure UI is being shown.
}; };
KioskLaunchController(); KioskLaunchController();
...@@ -168,9 +168,9 @@ class KioskLaunchController ...@@ -168,9 +168,9 @@ class KioskLaunchController
void LaunchApp(); void LaunchApp();
// Current state of the controller. // Current state of the controller.
AppState app_state_ = AppState::CREATING_PROFILE; AppState app_state_ = AppState::kCreatingProfile;
// Current state of network configure dialog. // Current state of network configure dialog.
NetworkUIState network_ui_state_ = NetworkUIState::NOT_SHOWING; NetworkUIState network_ui_state_ = NetworkUIState::kNotShowing;
LoginDisplayHost* const host_; // Not owned, destructed upon shutdown. LoginDisplayHost* const host_; // Not owned, destructed upon shutdown.
AppLaunchSplashScreenView* splash_screen_view_ = nullptr; // Owned by OobeUI. AppLaunchSplashScreenView* splash_screen_view_ = nullptr; // Owned by OobeUI.
......
...@@ -124,55 +124,55 @@ class KioskLaunchControllerTest ...@@ -124,55 +124,55 @@ class KioskLaunchControllerTest
IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest, RegularFlow) { IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest, RegularFlow) {
controller()->Start(kiosk_app_id(), false); controller()->Start(kiosk_app_id(), false);
ExpectState(AppState::CREATING_PROFILE, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kCreatingProfile, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), Initialize()).Times(1); EXPECT_CALL(*launcher(), Initialize()).Times(1);
profile_controls()->OnProfileLoaded(profile()); profile_controls()->OnProfileLoaded(profile());
launch_controls()->InitializeNetwork(); launch_controls()->InitializeNetwork();
ExpectState(AppState::INIT_NETWORK, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInitNetwork, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), ContinueWithNetworkReady()).Times(1); EXPECT_CALL(*launcher(), ContinueWithNetworkReady()).Times(1);
SetOnline(true); SetOnline(true);
launch_controls()->OnAppInstalling(); launch_controls()->OnAppInstalling();
launch_controls()->OnAppPrepared(); launch_controls()->OnAppPrepared();
ExpectState(AppState::INSTALLED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInstalled, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), LaunchApp()).Times(1); EXPECT_CALL(*launcher(), LaunchApp()).Times(1);
FireSplashScreenTimer(); FireSplashScreenTimer();
launch_controls()->OnAppLaunched(); launch_controls()->OnAppLaunched();
ExpectState(AppState::LAUNCHED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kLaunched, NetworkUIState::kNotShowing);
EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted()); EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted());
} }
IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest, AlreadyInstalled) { IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest, AlreadyInstalled) {
controller()->Start(kiosk_app_id(), false); controller()->Start(kiosk_app_id(), false);
ExpectState(AppState::CREATING_PROFILE, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kCreatingProfile, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), Initialize()).Times(1); EXPECT_CALL(*launcher(), Initialize()).Times(1);
profile_controls()->OnProfileLoaded(profile()); profile_controls()->OnProfileLoaded(profile());
launch_controls()->OnAppPrepared(); launch_controls()->OnAppPrepared();
ExpectState(AppState::INSTALLED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInstalled, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), LaunchApp()).Times(1); EXPECT_CALL(*launcher(), LaunchApp()).Times(1);
FireSplashScreenTimer(); FireSplashScreenTimer();
launch_controls()->OnAppLaunched(); launch_controls()->OnAppLaunched();
ExpectState(AppState::LAUNCHED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kLaunched, NetworkUIState::kNotShowing);
EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted()); EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted());
} }
IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest, IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest,
ConfigureNetworkBeforeProfile) { ConfigureNetworkBeforeProfile) {
controller()->Start(kiosk_app_id(), false); controller()->Start(kiosk_app_id(), false);
ExpectState(AppState::CREATING_PROFILE, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kCreatingProfile, NetworkUIState::kNotShowing);
// User presses the hotkey. // User presses the hotkey.
view_controls()->OnNetworkConfigRequested(); view_controls()->OnNetworkConfigRequested();
ExpectState(AppState::CREATING_PROFILE, NetworkUIState::NEED_TO_SHOW); ExpectState(AppState::kCreatingProfile, NetworkUIState::kNeedToShow);
EXPECT_CALL(*launcher(), Initialize()).Times(1); EXPECT_CALL(*launcher(), Initialize()).Times(1);
profile_controls()->OnProfileLoaded(profile()); profile_controls()->OnProfileLoaded(profile());
...@@ -180,7 +180,7 @@ IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest, ...@@ -180,7 +180,7 @@ IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest,
// response now. // response now.
launch_controls()->InitializeNetwork(); launch_controls()->InitializeNetwork();
ExpectState(AppState::INIT_NETWORK, NetworkUIState::SHOWING); ExpectState(AppState::kInitNetwork, NetworkUIState::kShowing);
EXPECT_CALL(*launcher(), RestartLauncher()).Times(1); EXPECT_CALL(*launcher(), RestartLauncher()).Times(1);
view_controls()->OnNetworkConfigFinished(); view_controls()->OnNetworkConfigFinished();
...@@ -191,7 +191,7 @@ IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest, ...@@ -191,7 +191,7 @@ IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest,
// network configure ui was shown. // network configure ui was shown.
launch_controls()->OnAppLaunched(); launch_controls()->OnAppLaunched();
ExpectState(AppState::LAUNCHED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kLaunched, NetworkUIState::kNotShowing);
EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted()); EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted());
} }
...@@ -199,13 +199,13 @@ IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest, ...@@ -199,13 +199,13 @@ IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest,
ConfigureNetworkDuringInstallation) { ConfigureNetworkDuringInstallation) {
SetOnline(false); SetOnline(false);
controller()->Start(kiosk_app_id(), false); controller()->Start(kiosk_app_id(), false);
ExpectState(AppState::CREATING_PROFILE, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kCreatingProfile, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), Initialize()).Times(1); EXPECT_CALL(*launcher(), Initialize()).Times(1);
profile_controls()->OnProfileLoaded(profile()); profile_controls()->OnProfileLoaded(profile());
launch_controls()->InitializeNetwork(); launch_controls()->InitializeNetwork();
ExpectState(AppState::INIT_NETWORK, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInitNetwork, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), ContinueWithNetworkReady()).Times(1); EXPECT_CALL(*launcher(), ContinueWithNetworkReady()).Times(1);
SetOnline(true); SetOnline(true);
...@@ -216,59 +216,59 @@ IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest, ...@@ -216,59 +216,59 @@ IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest,
view_controls()->OnNetworkConfigRequested(); view_controls()->OnNetworkConfigRequested();
// Launcher restart causes network to be requested again. // Launcher restart causes network to be requested again.
launch_controls()->InitializeNetwork(); launch_controls()->InitializeNetwork();
ExpectState(AppState::INIT_NETWORK, NetworkUIState::SHOWING); ExpectState(AppState::kInitNetwork, NetworkUIState::kShowing);
EXPECT_CALL(*launcher(), RestartLauncher()).Times(1); EXPECT_CALL(*launcher(), RestartLauncher()).Times(1);
view_controls()->OnNetworkConfigFinished(); view_controls()->OnNetworkConfigFinished();
launch_controls()->OnAppInstalling(); launch_controls()->OnAppInstalling();
ExpectState(AppState::INSTALLING_APP, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInstallingApp, NetworkUIState::kNotShowing);
launch_controls()->OnAppPrepared(); launch_controls()->OnAppPrepared();
ExpectState(AppState::INSTALLED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInstalled, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), LaunchApp()).Times(1); EXPECT_CALL(*launcher(), LaunchApp()).Times(1);
FireSplashScreenTimer(); FireSplashScreenTimer();
launch_controls()->OnAppLaunched(); launch_controls()->OnAppLaunched();
ExpectState(AppState::LAUNCHED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kLaunched, NetworkUIState::kNotShowing);
EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted()); EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted());
} }
IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest, IN_PROC_BROWSER_TEST_P(KioskLaunchControllerTest,
ConnectionLostDuringInstallation) { ConnectionLostDuringInstallation) {
controller()->Start(kiosk_app_id(), false); controller()->Start(kiosk_app_id(), false);
ExpectState(AppState::CREATING_PROFILE, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kCreatingProfile, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), Initialize()).Times(1); EXPECT_CALL(*launcher(), Initialize()).Times(1);
profile_controls()->OnProfileLoaded(profile()); profile_controls()->OnProfileLoaded(profile());
launch_controls()->InitializeNetwork(); launch_controls()->InitializeNetwork();
ExpectState(AppState::INIT_NETWORK, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInitNetwork, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), ContinueWithNetworkReady()).Times(1); EXPECT_CALL(*launcher(), ContinueWithNetworkReady()).Times(1);
SetOnline(true); SetOnline(true);
launch_controls()->OnAppInstalling(); launch_controls()->OnAppInstalling();
ExpectState(AppState::INSTALLING_APP, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInstallingApp, NetworkUIState::kNotShowing);
SetOnline(false); SetOnline(false);
launch_controls()->InitializeNetwork(); launch_controls()->InitializeNetwork();
ExpectState(AppState::INIT_NETWORK, NetworkUIState::SHOWING); ExpectState(AppState::kInitNetwork, NetworkUIState::kShowing);
EXPECT_CALL(*launcher(), RestartLauncher()).Times(1); EXPECT_CALL(*launcher(), RestartLauncher()).Times(1);
view_controls()->OnNetworkConfigFinished(); view_controls()->OnNetworkConfigFinished();
launch_controls()->OnAppInstalling(); launch_controls()->OnAppInstalling();
ExpectState(AppState::INSTALLING_APP, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInstallingApp, NetworkUIState::kNotShowing);
launch_controls()->OnAppPrepared(); launch_controls()->OnAppPrepared();
ExpectState(AppState::INSTALLED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInstalled, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), LaunchApp()).Times(1); EXPECT_CALL(*launcher(), LaunchApp()).Times(1);
FireSplashScreenTimer(); FireSplashScreenTimer();
launch_controls()->OnAppLaunched(); launch_controls()->OnAppLaunched();
ExpectState(AppState::LAUNCHED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kLaunched, NetworkUIState::kNotShowing);
EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted()); EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted());
} }
...@@ -328,13 +328,13 @@ class KioskLaunchControllerWithExtensionTest ...@@ -328,13 +328,13 @@ class KioskLaunchControllerWithExtensionTest
void RunUntilAppPrepared() { void RunUntilAppPrepared() {
controller()->Start(kiosk_app_id(), false); controller()->Start(kiosk_app_id(), false);
ExpectState(AppState::CREATING_PROFILE, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kCreatingProfile, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), Initialize()).Times(1); EXPECT_CALL(*launcher(), Initialize()).Times(1);
profile_controls()->OnProfileLoaded(profile()); profile_controls()->OnProfileLoaded(profile());
launch_controls()->InitializeNetwork(); launch_controls()->InitializeNetwork();
ExpectState(AppState::INIT_NETWORK, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInitNetwork, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), ContinueWithNetworkReady()).Times(1); EXPECT_CALL(*launcher(), ContinueWithNetworkReady()).Times(1);
SetOnline(true); SetOnline(true);
...@@ -361,29 +361,29 @@ IN_PROC_BROWSER_TEST_P(KioskLaunchControllerWithExtensionTest, ...@@ -361,29 +361,29 @@ IN_PROC_BROWSER_TEST_P(KioskLaunchControllerWithExtensionTest,
ExtensionLoadedBeforeAppPrepared) { ExtensionLoadedBeforeAppPrepared) {
SetExtensionLoaded(); SetExtensionLoaded();
RunUntilAppPrepared(); RunUntilAppPrepared();
ExpectState(AppState::INSTALLED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInstalled, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), LaunchApp()).Times(1); EXPECT_CALL(*launcher(), LaunchApp()).Times(1);
FireSplashScreenTimer(); FireSplashScreenTimer();
launch_controls()->OnAppLaunched(); launch_controls()->OnAppLaunched();
ExpectState(AppState::LAUNCHED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kLaunched, NetworkUIState::kNotShowing);
EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted()); EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted());
} }
IN_PROC_BROWSER_TEST_P(KioskLaunchControllerWithExtensionTest, IN_PROC_BROWSER_TEST_P(KioskLaunchControllerWithExtensionTest,
ExtensionLoadedAfterAppPrepared) { ExtensionLoadedAfterAppPrepared) {
RunUntilAppPrepared(); RunUntilAppPrepared();
ExpectState(AppState::INSTALLING_EXTENSIONS, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInstallingExtensions, NetworkUIState::kNotShowing);
SetExtensionLoaded(); SetExtensionLoaded();
ExpectState(AppState::INSTALLED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kInstalled, NetworkUIState::kNotShowing);
EXPECT_CALL(*launcher(), LaunchApp()).Times(1); EXPECT_CALL(*launcher(), LaunchApp()).Times(1);
FireSplashScreenTimer(); FireSplashScreenTimer();
launch_controls()->OnAppLaunched(); launch_controls()->OnAppLaunched();
ExpectState(AppState::LAUNCHED, NetworkUIState::NOT_SHOWING); ExpectState(AppState::kLaunched, NetworkUIState::kNotShowing);
EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted()); EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted());
} }
......
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