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

Side by Side Diff: ash/system/tray/tray_details_view_unittest.cc

Issue 2041233005: Moves ash::user::LoginStatus to ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « ash/system/tray/system_tray_unittest.cc ('k') | ash/system/tray/tray_empty.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/tray/tray_details_view.h" 5 #include "ash/system/tray/tray_details_view.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/shelf_widget.h" 8 #include "ash/shelf/shelf_widget.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/status_area_widget.h" 10 #include "ash/system/status_area_widget.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 DISALLOW_COPY_AND_ASSIGN(TestDetailsView); 75 DISALLOW_COPY_AND_ASSIGN(TestDetailsView);
76 }; 76 };
77 77
78 // Trivial item implementation that tracks its views for testing. 78 // Trivial item implementation that tracks its views for testing.
79 class TestItem : public SystemTrayItem { 79 class TestItem : public SystemTrayItem {
80 public: 80 public:
81 TestItem() : SystemTrayItem(GetSystemTray()), tray_view_(NULL) {} 81 TestItem() : SystemTrayItem(GetSystemTray()), tray_view_(NULL) {}
82 82
83 // Overridden from SystemTrayItem: 83 // Overridden from SystemTrayItem:
84 views::View* CreateTrayView(user::LoginStatus status) override { 84 views::View* CreateTrayView(LoginStatus status) override {
85 tray_view_ = new views::View; 85 tray_view_ = new views::View;
86 return tray_view_; 86 return tray_view_;
87 } 87 }
88 views::View* CreateDefaultView(user::LoginStatus status) override { 88 views::View* CreateDefaultView(LoginStatus status) override {
89 default_view_ = new views::View; 89 default_view_ = new views::View;
90 default_view_->SetFocusBehavior(views::View::FocusBehavior::ALWAYS); 90 default_view_->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
91 return default_view_; 91 return default_view_;
92 } 92 }
93 views::View* CreateDetailedView(user::LoginStatus status) override { 93 views::View* CreateDetailedView(LoginStatus status) override {
94 detailed_view_ = new TestDetailsView(this); 94 detailed_view_ = new TestDetailsView(this);
95 return detailed_view_; 95 return detailed_view_;
96 } 96 }
97 void DestroyTrayView() override { tray_view_ = NULL; } 97 void DestroyTrayView() override { tray_view_ = NULL; }
98 void DestroyDefaultView() override { default_view_ = NULL; } 98 void DestroyDefaultView() override { default_view_ = NULL; }
99 void DestroyDetailedView() override { detailed_view_ = NULL; } 99 void DestroyDetailedView() override { detailed_view_ = NULL; }
100 100
101 views::View* tray_view() const { return tray_view_; } 101 views::View* tray_view() const { return tray_view_; }
102 views::View* default_view() const { return default_view_; } 102 views::View* default_view() const { return default_view_; }
103 TestDetailsView* detailed_view() const { return detailed_view_; } 103 TestDetailsView* detailed_view() const { return detailed_view_; }
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 gfx::Rect bounds = button->GetBoundsInScreen(); 274 gfx::Rect bounds = button->GetBoundsInScreen();
275 gfx::Point initial_point(bounds.x() - 1, bounds.y()); 275 gfx::Point initial_point(bounds.x() - 1, bounds.y());
276 generator.set_current_location(initial_point); 276 generator.set_current_location(initial_point);
277 generator.MoveMouseBy(1, 0); 277 generator.MoveMouseBy(1, 0);
278 RunAllPendingInMessageLoop(); 278 RunAllPendingInMessageLoop();
279 EXPECT_TRUE(button->background()); 279 EXPECT_TRUE(button->background());
280 } 280 }
281 281
282 } // namespace test 282 } // namespace test
283 } // namespace ash 283 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/system_tray_unittest.cc ('k') | ash/system/tray/tray_empty.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698