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

Side by Side Diff: ash/shelf/shelf_widget_unittest.cc

Issue 2688353005: Fix shelf alignment and auto-hide initialization. (Closed)
Patch Set: Fix mash_unittests by installing a TestShellDelegate. Created 3 years, 10 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/common/shelf/shelf_widget.h" 5 #include "ash/common/shelf/shelf_widget.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/shelf/shelf_constants.h" 8 #include "ash/common/shelf/shelf_constants.h"
9 #include "ash/common/shelf/shelf_layout_manager.h" 9 #include "ash/common/shelf/shelf_layout_manager.h"
10 #include "ash/common/shelf/shelf_view.h" 10 #include "ash/common/shelf/shelf_view.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 : alignment_(alignment), auto_hide_(auto_hide) { 347 : alignment_(alignment), auto_hide_(auto_hide) {
348 WmShell::Get()->AddShellObserver(this); 348 WmShell::Get()->AddShellObserver(this);
349 } 349 }
350 ~ShelfInitializer() override { WmShell::Get()->RemoveShellObserver(this); } 350 ~ShelfInitializer() override { WmShell::Get()->RemoveShellObserver(this); }
351 351
352 // ShellObserver: 352 // ShellObserver:
353 void OnShelfCreatedForRootWindow(WmWindow* root_window) override { 353 void OnShelfCreatedForRootWindow(WmWindow* root_window) override {
354 WmShelf* shelf = root_window->GetRootWindowController()->GetShelf(); 354 WmShelf* shelf = root_window->GetRootWindowController()->GetShelf();
355 shelf->SetAlignment(alignment_); 355 shelf->SetAlignment(alignment_);
356 shelf->SetAutoHideBehavior(auto_hide_); 356 shelf->SetAutoHideBehavior(auto_hide_);
357 shelf->UpdateVisibilityState();
357 } 358 }
358 359
359 private: 360 private:
360 ShelfAlignment alignment_; 361 ShelfAlignment alignment_;
361 ShelfAutoHideBehavior auto_hide_; 362 ShelfAutoHideBehavior auto_hide_;
362 363
363 DISALLOW_COPY_AND_ASSIGN(ShelfInitializer); 364 DISALLOW_COPY_AND_ASSIGN(ShelfInitializer);
364 }; 365 };
365 366
366 class ShelfWidgetTestWithInitializer : public ShelfWidgetTest { 367 class ShelfWidgetTestWithInitializer : public ShelfWidgetTest {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 429 }
429 430
430 TEST_P(ShelfWidgetTestWithInitializer, CreateLockedShelf) { 431 TEST_P(ShelfWidgetTestWithInitializer, CreateLockedShelf) {
431 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior. 432 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior.
432 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_BOTTOM_LOCKED, 433 TestCreateShelfWithInitialValues(SHELF_ALIGNMENT_BOTTOM_LOCKED,
433 SHELF_AUTO_HIDE_BEHAVIOR_NEVER, 434 SHELF_AUTO_HIDE_BEHAVIOR_NEVER,
434 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN); 435 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN);
435 } 436 }
436 437
437 } // namespace ash 438 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698