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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 2162153002: Added Ash.SystemMenu.DefaultView.VisibleItems histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the COUNT value from the SystemMenuDefaultViewRows enum. Created 4 years, 5 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/common/system/user/tray_user_separator.cc ('k') | ash/system/chromeos/rotation/tray_rotation_lock.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager_unittest.cc
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index 76a09e53bab72f653244cb6c014745fe55520655..54f253cecc56f33921e58645b4d871f8592abbbb 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -30,10 +30,10 @@
#include "ash/test/ash_test_base.h"
#include "ash/test/display_manager_test_api.h"
#include "ash/test/shelf_test_api.h"
+#include "ash/test/test_system_tray_item.h"
#include "ash/wm/window_state_aura.h"
#include "ash/wm/window_util.h"
#include "base/command_line.h"
-#include "base/strings/utf_string_conversions.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/window_tree_client.h"
#include "ui/aura/window.h"
@@ -46,8 +46,6 @@
#include "ui/display/screen.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "ui/events/test/event_generator.h"
-#include "ui/views/controls/label.h"
-#include "ui/views/layout/fill_layout.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
@@ -263,68 +261,6 @@ class ShelfLayoutObserverTest : public ShelfLayoutManagerObserver {
DISALLOW_COPY_AND_ASSIGN(ShelfLayoutObserverTest);
};
-// Trivial item implementation that tracks its views for testing.
-class TestItem : public SystemTrayItem {
- public:
- TestItem()
- : SystemTrayItem(GetSystemTray()),
- tray_view_(nullptr),
- default_view_(nullptr),
- detailed_view_(nullptr),
- notification_view_(nullptr) {}
-
- views::View* CreateTrayView(LoginStatus status) override {
- tray_view_ = new views::View;
- // Add a label so it has non-zero width.
- tray_view_->SetLayoutManager(new views::FillLayout);
- tray_view_->AddChildView(new views::Label(base::UTF8ToUTF16("Tray")));
- return tray_view_;
- }
-
- views::View* CreateDefaultView(LoginStatus status) override {
- default_view_ = new views::View;
- default_view_->SetLayoutManager(new views::FillLayout);
- default_view_->AddChildView(new views::Label(base::UTF8ToUTF16("Default")));
- return default_view_;
- }
-
- views::View* CreateDetailedView(LoginStatus status) override {
- detailed_view_ = new views::View;
- detailed_view_->SetLayoutManager(new views::FillLayout);
- detailed_view_->AddChildView(
- new views::Label(base::UTF8ToUTF16("Detailed")));
- return detailed_view_;
- }
-
- views::View* CreateNotificationView(LoginStatus status) override {
- notification_view_ = new views::View;
- return notification_view_;
- }
-
- void DestroyTrayView() override { tray_view_ = nullptr; }
-
- void DestroyDefaultView() override { default_view_ = nullptr; }
-
- void DestroyDetailedView() override { detailed_view_ = nullptr; }
-
- void DestroyNotificationView() override { notification_view_ = nullptr; }
-
- void UpdateAfterLoginStatusChange(LoginStatus status) override {}
-
- views::View* tray_view() const { return tray_view_; }
- views::View* default_view() const { return default_view_; }
- views::View* detailed_view() const { return detailed_view_; }
- views::View* notification_view() const { return notification_view_; }
-
- private:
- views::View* tray_view_;
- views::View* default_view_;
- views::View* detailed_view_;
- views::View* notification_view_;
-
- DISALLOW_COPY_AND_ASSIGN(TestItem);
-};
-
} // namespace
class ShelfLayoutManagerTest : public test::AshTestBase {
@@ -2124,7 +2060,7 @@ TEST_F(ShelfLayoutManagerTest, BubbleEnlargesShelfMouseHitArea) {
EXPECT_FALSE(status_area_widget->IsMessageBubbleShown());
} else {
// In our second iteration we show a bubble.
- TestItem* item = new TestItem;
+ test::TestSystemTrayItem* item = new test::TestSystemTrayItem();
tray->AddTrayItem(item);
tray->ShowNotificationView(item);
EXPECT_TRUE(status_area_widget->IsMessageBubbleShown());
« no previous file with comments | « ash/common/system/user/tray_user_separator.cc ('k') | ash/system/chromeos/rotation/tray_rotation_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698