| OLD | NEW |
| 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 material_design_state_.reset(new test::MaterialDesignControllerTestAPI( | 20 material_design_state_.reset(new test::MaterialDesignControllerTestAPI( |
| 21 MaterialDesignController::Mode::NON_MATERIAL)); | 21 MaterialDesignController::Mode::NON_MATERIAL)); |
| 22 const int non_md_shelf_size = GetShelfConstant(SHELF_SIZE); | 22 const int non_md_shelf_size = GetShelfConstant(SHELF_SIZE); |
| 23 const int non_md_auto_hide_shelf_size = |
| 24 GetShelfConstant(SHELF_INSETS_FOR_AUTO_HIDE); |
| 23 | 25 |
| 24 material_design_state_.reset( | 26 material_design_state_.reset( |
| 25 new test::MaterialDesignControllerTestAPI(GetParam())); | 27 new test::MaterialDesignControllerTestAPI(GetParam())); |
| 26 const int md_state_shelf_size = GetShelfConstant(SHELF_SIZE); | 28 const int md_state_shelf_size = GetShelfConstant(SHELF_SIZE); |
| 29 const int md_state_auto_hide_shelf_size = |
| 30 GetShelfConstant(SHELF_INSETS_FOR_AUTO_HIDE); |
| 27 | 31 |
| 28 md_maximized_window_height_offset_ = non_md_shelf_size - md_state_shelf_size; | 32 md_maximized_window_height_offset_ = non_md_shelf_size - md_state_shelf_size; |
| 33 md_auto_hidden_shelf_height_offset_ = |
| 34 non_md_auto_hide_shelf_size - md_state_auto_hide_shelf_size; |
| 29 } | 35 } |
| 30 | 36 |
| 31 void AshMDTestBase::TearDown() { | 37 void AshMDTestBase::TearDown() { |
| 32 material_design_state_.reset(); | 38 material_design_state_.reset(); |
| 33 AshTestBase::TearDown(); | 39 AshTestBase::TearDown(); |
| 34 } | 40 } |
| 35 | 41 |
| 36 int AshMDTestBase::GetMdMaximizedWindowHeightOffset() { | 42 int AshMDTestBase::GetMdMaximizedWindowHeightOffset() { |
| 37 return md_maximized_window_height_offset_; | 43 return md_maximized_window_height_offset_; |
| 38 } | 44 } |
| 39 | 45 |
| 46 int AshMDTestBase::GetMdAutoHiddenShelfHeightOffset() { |
| 47 return md_auto_hidden_shelf_height_offset_; |
| 48 } |
| 49 |
| 40 } // namespace test | 50 } // namespace test |
| 41 } // namespace ash | 51 } // namespace ash |
| OLD | NEW |