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

Side by Side 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: Fixed ash_unittests compile errors. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accelerators/accelerator_table.h" 8 #include "ash/accelerators/accelerator_table.h"
9 #include "ash/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 bool changed_auto_hide_state_; 261 bool changed_auto_hide_state_;
262 262
263 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutObserverTest); 263 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutObserverTest);
264 }; 264 };
265 265
266 // Trivial item implementation that tracks its views for testing. 266 // Trivial item implementation that tracks its views for testing.
267 class TestItem : public SystemTrayItem { 267 class TestItem : public SystemTrayItem {
268 public: 268 public:
269 TestItem() 269 TestItem()
270 : SystemTrayItem(GetSystemTray()), 270 : SystemTrayItem(GetSystemTray(), NETWORK),
271 tray_view_(nullptr), 271 tray_view_(nullptr),
272 default_view_(nullptr), 272 default_view_(nullptr),
273 detailed_view_(nullptr), 273 detailed_view_(nullptr),
274 notification_view_(nullptr) {} 274 notification_view_(nullptr) {}
275 275
276 views::View* CreateTrayView(LoginStatus status) override { 276 views::View* CreateTrayView(LoginStatus status) override {
277 tray_view_ = new views::View; 277 tray_view_ = new views::View;
278 // Add a label so it has non-zero width. 278 // Add a label so it has non-zero width.
279 tray_view_->SetLayoutManager(new views::FillLayout); 279 tray_view_->SetLayoutManager(new views::FillLayout);
280 tray_view_->AddChildView(new views::Label(base::UTF8ToUTF16("Tray"))); 280 tray_view_->AddChildView(new views::Label(base::UTF8ToUTF16("Tray")));
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after
2282 ->shelf_widget() 2282 ->shelf_widget()
2283 ->status_area_widget(); 2283 ->status_area_widget();
2284 EXPECT_TRUE(status_area_widget->IsVisible()); 2284 EXPECT_TRUE(status_area_widget->IsVisible());
2285 // Shelf should be in the first display's area. 2285 // Shelf should be in the first display's area.
2286 gfx::Rect status_area_bounds(status_area_widget->GetWindowBoundsInScreen()); 2286 gfx::Rect status_area_bounds(status_area_widget->GetWindowBoundsInScreen());
2287 EXPECT_TRUE(gfx::Rect(0, 0, 500, 400).Contains(status_area_bounds)); 2287 EXPECT_TRUE(gfx::Rect(0, 0, 500, 400).Contains(status_area_bounds));
2288 EXPECT_EQ(gfx::Point(500, 400), status_area_bounds.bottom_right()); 2288 EXPECT_EQ(gfx::Point(500, 400), status_area_bounds.bottom_right());
2289 } 2289 }
2290 2290
2291 } // namespace ash 2291 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698