Commit 7427bd7a authored by Manu Cornet's avatar Manu Cornet Committed by Commit Bot

CrOS Shelf: Remove gratuitous test expectations

I am not really sure what these expectations are supposed to test.

SKColorTRANSPARENT is defined as R = G = B = A = 0. So GetBaseColor() of
SkColorTRANSPARENT is black.

So what these expectations are testing is basically that the shelf
background target color always gets back to a hardcoded black,
which doesn't seem desirable (that color can change and is defined as
shelf "base color" in shelf_constants.h, this sounds like a
"change detector" test that isn't helping much) and seems very
different from what the test claims to be checking in the first place.

This removes some expectations where they didn't really make sense.

Change-Id: Ic346b0aade25790d3645bb987c8bc483e39ebb6b
Reviewed-on: https://chromium-review.googlesource.com/c/1493084
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636581}
parent 756b04dd
...@@ -316,40 +316,15 @@ TEST_F(ShelfBackgroundTargetColorTest, ...@@ -316,40 +316,15 @@ TEST_F(ShelfBackgroundTargetColorTest,
->background_animator_for_testing()); ->background_animator_for_testing());
NotifySessionStateChanged(session_manager::SessionState::LOGIN_PRIMARY); NotifySessionStateChanged(session_manager::SessionState::LOGIN_PRIMARY);
EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()), EXPECT_EQ(test_api.shelf_background_target_color(), SK_ColorTRANSPARENT);
GetBaseColor(SK_ColorTRANSPARENT));
SimulateUserLogin("user1@test.com"); SimulateUserLogin("user1@test.com");
NotifySessionStateChanged(
session_manager::SessionState::LOGGED_IN_NOT_ACTIVE);
EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()),
GetBaseColor(SK_ColorTRANSPARENT));
// The shelf has a non-transparent background only when session state is // The shelf has a non-transparent background only when session state is
// active. // active.
NotifySessionStateChanged(session_manager::SessionState::ACTIVE); NotifySessionStateChanged(session_manager::SessionState::ACTIVE);
EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()), EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()),
GetBaseColor(kShelfDefaultBaseColor)); GetBaseColor(kShelfDefaultBaseColor));
NotifySessionStateChanged(session_manager::SessionState::LOCKED);
EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()),
GetBaseColor(SK_ColorTRANSPARENT));
// Ensure the shelf background color is correct after unlocking.
NotifySessionStateChanged(session_manager::SessionState::ACTIVE);
EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()),
GetBaseColor(kShelfDefaultBaseColor));
NotifySessionStateChanged(session_manager::SessionState::LOGIN_SECONDARY);
EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()),
GetBaseColor(SK_ColorTRANSPARENT));
// Ensure the shelf background color is correct after closing the user adding
// screen.
NotifySessionStateChanged(session_manager::SessionState::ACTIVE);
EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()),
GetBaseColor(kShelfDefaultBaseColor));
} }
// Verify the target colors of the shelf and item backgrounds are updated based // Verify the target colors of the shelf and item backgrounds are updated based
...@@ -366,15 +341,13 @@ TEST_F(ShelfBackgroundTargetColorTest, ...@@ -366,15 +341,13 @@ TEST_F(ShelfBackgroundTargetColorTest,
->background_animator_for_testing()); ->background_animator_for_testing());
NotifySessionStateChanged(session_manager::SessionState::OOBE); NotifySessionStateChanged(session_manager::SessionState::OOBE);
EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()), EXPECT_EQ(test_api.shelf_background_target_color(), SK_ColorTRANSPARENT);
GetBaseColor(SK_ColorTRANSPARENT));
SimulateUserLogin("user1@test.com"); SimulateUserLogin("user1@test.com");
NotifySessionStateChanged( NotifySessionStateChanged(
session_manager::SessionState::LOGGED_IN_NOT_ACTIVE); session_manager::SessionState::LOGGED_IN_NOT_ACTIVE);
EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()), EXPECT_EQ(test_api.shelf_background_target_color(), SK_ColorTRANSPARENT);
GetBaseColor(SK_ColorTRANSPARENT));
NotifySessionStateChanged(session_manager::SessionState::ACTIVE); NotifySessionStateChanged(session_manager::SessionState::ACTIVE);
EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()), EXPECT_EQ(GetBaseColor(test_api.shelf_background_target_color()),
......
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