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

Side by Side Diff: ash/test/ash_md_test_base.cc

Issue 2165693002: Fix tests in when MD is set to EXPERIMENTAL by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/test/ash_md_test_base.h" 5 #include "ash/test/ash_md_test_base.h"
6 6
7 #include "ash/common/shelf/shelf_constants.h" 7 #include "ash/common/shelf/shelf_constants.h"
8 #include "ash/test/material_design_controller_test_api.h" 8 #include "ash/test/material_design_controller_test_api.h"
9 9
10 namespace ash { 10 namespace ash {
11 namespace test { 11 namespace test {
12 12
13 AshMDTestBase::AshMDTestBase() {} 13 AshMDTestBase::AshMDTestBase() {}
14 14
15 AshMDTestBase::~AshMDTestBase() {} 15 AshMDTestBase::~AshMDTestBase() {}
16 16
17 void AshMDTestBase::SetUp() { 17 void AshMDTestBase::SetUp() {
18 AshTestBase::SetUp(); 18 AshTestBase::SetUp();
19 19
20 // initialize md_maximized_window_height_offset_
20 material_design_state_.reset(new test::MaterialDesignControllerTestAPI( 21 material_design_state_.reset(new test::MaterialDesignControllerTestAPI(
21 MaterialDesignController::Mode::NON_MATERIAL)); 22 MaterialDesignController::Mode::NON_MATERIAL));
22 const int non_md_shelf_size = GetShelfConstant(SHELF_SIZE); 23 const int non_md_shelf_size = GetShelfConstant(SHELF_SIZE);
23 24
24 material_design_state_.reset( 25 material_design_state_.reset(
25 new test::MaterialDesignControllerTestAPI(GetParam())); 26 new test::MaterialDesignControllerTestAPI(GetParam()));
26 const int md_state_shelf_size = GetShelfConstant(SHELF_SIZE); 27 const int md_state_shelf_size = GetShelfConstant(SHELF_SIZE);
27 28
28 md_maximized_window_height_offset_ = non_md_shelf_size - md_state_shelf_size; 29 md_maximized_window_height_offset_ = non_md_shelf_size - md_state_shelf_size;
30
31 // initialize md_auto_hidden_shelf_height_offset_
32 material_design_state_.reset(new test::MaterialDesignControllerTestAPI(
33 MaterialDesignController::Mode::NON_MATERIAL));
34 const int non_md_auto_hide_shelf_size =
tdanderson 2016/07/19 21:10:23 I think you should be able to: * Move line 34 to
yiyix 2016/07/20 06:03:07 It works. We need to reset material_design_state l
35 GetShelfConstant(SHELF_INSETS_FOR_AUTO_HIDE);
36
37 material_design_state_.reset(
38 new test::MaterialDesignControllerTestAPI(GetParam()));
39 const int md_state_auto_hide_shelf_size =
40 GetShelfConstant(SHELF_INSETS_FOR_AUTO_HIDE);
41
42 md_auto_hidden_shelf_height_offset_ =
43 non_md_auto_hide_shelf_size - md_state_auto_hide_shelf_size;
29 } 44 }
30 45
31 void AshMDTestBase::TearDown() { 46 void AshMDTestBase::TearDown() {
32 material_design_state_.reset(); 47 material_design_state_.reset();
33 AshTestBase::TearDown(); 48 AshTestBase::TearDown();
34 } 49 }
35 50
36 int AshMDTestBase::GetMdMaximizedWindowHeightOffset() { 51 int AshMDTestBase::GetMdMaximizedWindowHeightOffset() {
37 return md_maximized_window_height_offset_; 52 return md_maximized_window_height_offset_;
38 } 53 }
39 54
55 int AshMDTestBase::GetMdAutoHiddenShelfHeightOffset() {
56 return md_auto_hidden_shelf_height_offset_;
57 }
58
40 } // namespace test 59 } // namespace test
41 } // namespace ash 60 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698