Commit 0b38d859 authored by James Cook's avatar James Cook Committed by Commit Bot

cros: Fix PreferencesTest.MultiProfiles and re-enable everywhere

The crashes under --mash are due to heap corruption from code trying
to disable multi-user switching animations. That code does not seem
necessary any more. Per crrev.com/223823004 when it was added this
test was reliably failing. The multi-user switch animations have
been recently refactored and a shelf animation removed. The test
now passes even without the animation disabling code.

I cannot reproduce failures or crashes without --mash. I've done
ASAN runs as well. I suspect the non-mash problem in the bug is
unrelated to this test and may have been fixed separately.

Bug: 787050
Test: browser_tests --gtest_filter=PreferencesTest.* --gtest_repeat=100
Change-Id: I08dc3897361440fdbd49df1a11429e06fb9bac51
Reviewed-on: https://chromium-review.googlesource.com/804401Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521134}
parent a0d5a643
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
#include "chrome/browser/chromeos/system/fake_input_device_settings.h" #include "chrome/browser/chromeos/system/fake_input_device_settings.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
...@@ -134,15 +133,6 @@ class PreferencesTest : public LoginManagerTest { ...@@ -134,15 +133,6 @@ class PreferencesTest : public LoginManagerTest {
prefs->GetBoolean(prefs::kPrimaryMouseButtonRight)); prefs->GetBoolean(prefs::kPrimaryMouseButtonRight));
} }
void DisableAnimations() {
// Disable animations for user transitions.
MultiUserWindowManagerChromeOS* manager =
static_cast<MultiUserWindowManagerChromeOS*>(
MultiUserWindowManager::GetInstance());
manager->SetAnimationSpeedForTest(
MultiUserWindowManagerChromeOS::ANIMATION_SPEED_DISABLED);
}
std::vector<AccountId> test_users_; std::vector<AccountId> test_users_;
private: private:
...@@ -213,8 +203,7 @@ IN_PROC_BROWSER_TEST_F(PreferencesTest, PRE_MultiProfiles) { ...@@ -213,8 +203,7 @@ IN_PROC_BROWSER_TEST_F(PreferencesTest, PRE_MultiProfiles) {
chromeos::StartupUtils::MarkOobeCompleted(); chromeos::StartupUtils::MarkOobeCompleted();
} }
// This test is flaking both with and without mash. http://crbug.com/787050 IN_PROC_BROWSER_TEST_F(PreferencesTest, MultiProfiles) {
IN_PROC_BROWSER_TEST_F(PreferencesTest, DISABLED_MultiProfiles) {
user_manager::UserManager* user_manager = user_manager::UserManager::Get(); user_manager::UserManager* user_manager = user_manager::UserManager::Get();
// Add first user and init its preferences. Check that corresponding // Add first user and init its preferences. Check that corresponding
...@@ -230,7 +219,6 @@ IN_PROC_BROWSER_TEST_F(PreferencesTest, DISABLED_MultiProfiles) { ...@@ -230,7 +219,6 @@ IN_PROC_BROWSER_TEST_F(PreferencesTest, DISABLED_MultiProfiles) {
// Add second user and init its prefs with different values. // Add second user and init its prefs with different values.
UserAddingScreen::Get()->Start(); UserAddingScreen::Get()->Start();
content::RunAllPendingInMessageLoop(); content::RunAllPendingInMessageLoop();
DisableAnimations();
AddUser(test_users_[1].GetUserEmail()); AddUser(test_users_[1].GetUserEmail());
content::RunAllPendingInMessageLoop(); content::RunAllPendingInMessageLoop();
const user_manager::User* user2 = user_manager->FindUser(test_users_[1]); const user_manager::User* user2 = user_manager->FindUser(test_users_[1]);
......
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