Commit 5e45d793 authored by Jit Yao Yap's avatar Jit Yao Yap Committed by Commit Bot

Fix flaky LaunchManagedGuestSession test

Use a SessionStateWaiter instead of checking the SessionState directly
as the check might be racy.

Bug: 1014239
Change-Id: I521b3ba0c2247603fc7ff5dc2bb31eaa9a2f2a73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1862676Reviewed-by: default avatarAlexander Hendrich <hendrich@chromium.org>
Commit-Queue: Jit Yao Yap <jityao@google.com>
Cr-Commit-Position: refs/heads/master@{#705970}
parent 51ab46b5
...@@ -11,11 +11,12 @@ ...@@ -11,11 +11,12 @@
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/extensions/login_screen/login_screen_apitest_base.h" #include "chrome/browser/chromeos/extensions/login_screen/login_screen_apitest_base.h"
#include "chrome/browser/chromeos/login/test/local_policy_test_server_mixin.h" #include "chrome/browser/chromeos/login/test/local_policy_test_server_mixin.h"
#include "chrome/browser/chromeos/login/test/session_manager_state_waiter.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/proto/chrome_device_policy.pb.h" #include "components/policy/proto/chrome_device_policy.pb.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/session_manager/core/session_manager.h" #include "components/session_manager/session_manager_types.h"
#include "components/user_manager/user_type.h" #include "components/user_manager/user_type.h"
#include "components/version_info/version_info.h" #include "components/version_info/version_info.h"
#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_observer.h"
...@@ -69,11 +70,10 @@ class LoginApitest : public LoginScreenApitestBase { ...@@ -69,11 +70,10 @@ class LoginApitest : public LoginScreenApitestBase {
DISALLOW_COPY_AND_ASSIGN(LoginApitest); DISALLOW_COPY_AND_ASSIGN(LoginApitest);
}; };
// Flaky. https://crbug.com/1014239 IN_PROC_BROWSER_TEST_F(LoginApitest, LaunchManagedGuestSession) {
IN_PROC_BROWSER_TEST_F(LoginApitest, DISABLED_LaunchManagedGuestSession) {
SetUpDeviceLocalAccountPolicy(); SetUpDeviceLocalAccountPolicy();
SetUpExtensionAndRunTest(kLaunchManagedGuestSession); SetUpExtensionAndRunTest(kLaunchManagedGuestSession);
EXPECT_TRUE(session_manager::SessionManager::Get()->IsSessionStarted()); SessionStateWaiter(session_manager::SessionState::ACTIVE).Wait();
// Check that the active user is of type |USER_TYPE_PUBLIC_ACCOUNT|. // Check that the active user is of type |USER_TYPE_PUBLIC_ACCOUNT|.
// We cannot use the email as an identifier as a different email is generated // We cannot use the email as an identifier as a different email is generated
......
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