Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1305)

Unified Diff: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc

Issue 1497973002: This CL replaces e-mail with AccountId in wallpaper manager code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
index 3e06d30888d212e09042b972728a4566a6ab21fd..37a0b3dffcdb4be9624bc61f80e8fcc715954c7b 100644
--- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
+++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
@@ -43,6 +43,10 @@
namespace {
+const char kAAccountIdString[] = "{\"email\":\"A\",\"gaia_id\":\"\"}";
+const char kBAccountIdString[] = "{\"email\":\"B\",\"gaia_id\":\"\"}";
+const char kArrowBAccountIdString[] = "->{\"email\":\"B\",\"gaia_id\":\"\"}";
+
// TOOD(beng): This implementation seems only superficially different to the
// production impl. Evaluate whether or not we can just use that
// one.
@@ -1016,7 +1020,8 @@ TEST_F(MultiUserWindowManagerChromeOSTest, AnimationSteps) {
// new one is becoming visible, the background starts transitionining and the
// shelf hides.
StartUserTransitionAnimation(account_id_B);
- EXPECT_EQ("->B", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kArrowBAccountIdString,
+ GetWallpaperUserIdForTest());
EXPECT_EQ("H[A], S[B], H[C]", GetStatus());
EXPECT_EQ(0.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(1.0f, window(1)->layer()->GetTargetOpacity());
@@ -1030,7 +1035,8 @@ TEST_F(MultiUserWindowManagerChromeOSTest, AnimationSteps) {
// which should set the shelf to its users state. Since that isn't there we
// can only make sure that it stays where it is.
AdvanceUserTransitionAnimation();
- EXPECT_EQ("->B", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kArrowBAccountIdString,
+ GetWallpaperUserIdForTest());
EXPECT_EQ("H[A], S[B], H[C]", GetStatus());
EXPECT_EQ(0.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(1.0f, window(1)->layer()->GetTargetOpacity());
@@ -1042,7 +1048,7 @@ TEST_F(MultiUserWindowManagerChromeOSTest, AnimationSteps) {
// After the finalize the animation of the wallpaper should be finished.
AdvanceUserTransitionAnimation();
EXPECT_FALSE(shelf->IsShelfHiddenBehindBlackBar());
- EXPECT_EQ("B", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kBAccountIdString, GetWallpaperUserIdForTest());
}
// Test that the screen coverage is properly determined.
@@ -1088,21 +1094,21 @@ TEST_F(MultiUserWindowManagerChromeOSTest, AnimationStepsMaximizeToNormal) {
// Start the animation and see that the new background is immediately set.
StartUserTransitionAnimation(account_id_B);
EXPECT_EQ("H[A], S[B], H[C]", GetStatus());
- EXPECT_EQ("B", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kBAccountIdString, GetWallpaperUserIdForTest());
EXPECT_EQ(0.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(1.0f, window(1)->layer()->GetTargetOpacity());
// The next step will not change anything.
AdvanceUserTransitionAnimation();
EXPECT_EQ("H[A], S[B], H[C]", GetStatus());
- EXPECT_EQ("B", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kBAccountIdString, GetWallpaperUserIdForTest());
EXPECT_EQ(0.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(1.0f, window(1)->layer()->GetTargetOpacity());
// The final step will also not have any visible impact.
AdvanceUserTransitionAnimation();
EXPECT_EQ("H[A], S[B], H[C]", GetStatus());
- EXPECT_EQ("B", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kBAccountIdString, GetWallpaperUserIdForTest());
EXPECT_EQ(0.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(1.0f, window(1)->layer()->GetTargetOpacity());
}
@@ -1148,7 +1154,7 @@ TEST_F(MultiUserWindowManagerChromeOSTest, AnimationStepsNormalToMaximized) {
// The final step however will switch the background.
AdvanceUserTransitionAnimation();
EXPECT_EQ("H[A], S[B], H[C]", GetStatus());
- EXPECT_EQ("B", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kBAccountIdString, GetWallpaperUserIdForTest());
EXPECT_EQ(0.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(1.0f, window(1)->layer()->GetTargetOpacity());
}
@@ -1181,42 +1187,42 @@ TEST_F(MultiUserWindowManagerChromeOSTest, AnimationStepsMaximizedToMaximized) {
// the new user).
StartUserTransitionAnimation(account_id_B);
EXPECT_EQ("H[A], S[B], H[C]", GetStatus());
- EXPECT_EQ("B", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kBAccountIdString, GetWallpaperUserIdForTest());
EXPECT_EQ(0.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(1.0f, window(1)->layer()->GetTargetOpacity());
// The next step will not change anything.
AdvanceUserTransitionAnimation();
EXPECT_EQ("H[A], S[B], H[C]", GetStatus());
- EXPECT_EQ("B", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kBAccountIdString, GetWallpaperUserIdForTest());
EXPECT_EQ(0.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(1.0f, window(1)->layer()->GetTargetOpacity());
// The final step however will hide the old window.
AdvanceUserTransitionAnimation();
EXPECT_EQ("H[A], S[B], H[C]", GetStatus());
- EXPECT_EQ("B", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kBAccountIdString, GetWallpaperUserIdForTest());
EXPECT_EQ(0.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(1.0f, window(1)->layer()->GetTargetOpacity());
// Switching back will do the exact same thing.
StartUserTransitionAnimation(account_id_A);
EXPECT_EQ("S[A], H[B], H[C]", GetStatus());
- EXPECT_EQ("A", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kAAccountIdString, GetWallpaperUserIdForTest());
EXPECT_EQ(1.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(0.0f, window(1)->layer()->GetTargetOpacity());
// The next step will not change anything.
AdvanceUserTransitionAnimation();
EXPECT_EQ("S[A], H[B], H[C]", GetStatus());
- EXPECT_EQ("A", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kAAccountIdString, GetWallpaperUserIdForTest());
EXPECT_EQ(1.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(0.0f, window(1)->layer()->GetTargetOpacity());
// The final step is also not changing anything to the status.
AdvanceUserTransitionAnimation();
EXPECT_EQ("S[A], H[B], H[C]", GetStatus());
- EXPECT_EQ("A", GetWallpaperUserIdForTest());
+ EXPECT_EQ(kAAccountIdString, GetWallpaperUserIdForTest());
EXPECT_EQ(1.0f, window(0)->layer()->GetTargetOpacity());
EXPECT_EQ(0.0f, window(1)->layer()->GetTargetOpacity());
}

Powered by Google App Engine
This is Rietveld 408576698