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

Unified Diff: ash/frame/custom_frame_view_ash_unittest.cc

Issue 2910773002: cros: CustomFrameViewAsh avatar icon from a window prop (Closed)
Patch Set: add test Created 3 years, 7 months 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
« no previous file with comments | « ash/frame/custom_frame_view_ash.cc ('k') | ash/frame/header_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/frame/custom_frame_view_ash_unittest.cc
diff --git a/ash/frame/custom_frame_view_ash_unittest.cc b/ash/frame/custom_frame_view_ash_unittest.cc
index 0d797e777a18c95c0b813093e7bb49e20932d6f6..b524b63cb46b2ff1ed637b50067e5311638fca53 100644
--- a/ash/frame/custom_frame_view_ash_unittest.cc
+++ b/ash/frame/custom_frame_view_ash_unittest.cc
@@ -12,8 +12,8 @@
#include "ash/shell.h"
#include "ash/shell_port.h"
#include "ash/test/ash_test_base.h"
-#include "ash/test/test_session_state_delegate.h"
#include "ash/wm/maximize_mode/maximize_mode_controller.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_unittest_util.h"
@@ -108,11 +108,6 @@ class CustomFrameViewAshTest : public test::AshTestBase {
return widget;
}
- test::TestSessionStateDelegate* GetTestSessionStateDelegate() {
- return static_cast<test::TestSessionStateDelegate*>(
- ShellPort::Get()->GetSessionStateDelegate());
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAshTest);
};
@@ -179,7 +174,7 @@ TEST_F(CustomFrameViewAshTest, MinimumAndMaximumSize) {
}
// Verify that CustomFrameViewAsh updates the avatar icon based on the
-// state of the SessionStateDelegate after visibility change.
+// avatar icon window property.
TEST_F(CustomFrameViewAshTest, AvatarIcon) {
TestWidgetConstraintsDelegate* delegate = new TestWidgetConstraintsDelegate;
std::unique_ptr<views::Widget> widget(CreateWidget(delegate));
@@ -188,17 +183,14 @@ TEST_F(CustomFrameViewAshTest, AvatarIcon) {
EXPECT_FALSE(custom_frame_view->GetAvatarIconViewForTest());
// Avatar image becomes available.
- GetTestSessionStateDelegate()->SetUserImage(
- gfx::test::CreateImage(27, 27).AsImageSkia());
- widget->Hide();
- widget->Show();
+ widget->GetNativeWindow()->SetProperty(
+ aura::client::kAvatarIconKey,
+ new gfx::ImageSkia(gfx::test::CreateImage(27, 27).AsImageSkia()));
EXPECT_TRUE(custom_frame_view->GetAvatarIconViewForTest());
// Avatar image is gone; the ImageView for the avatar icon should be
// removed.
- GetTestSessionStateDelegate()->SetUserImage(gfx::ImageSkia());
- widget->Hide();
- widget->Show();
+ widget->GetNativeWindow()->ClearProperty(aura::client::kAvatarIconKey);
EXPECT_FALSE(custom_frame_view->GetAvatarIconViewForTest());
}
« no previous file with comments | « ash/frame/custom_frame_view_ash.cc ('k') | ash/frame/header_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698