OLD | NEW |
---|---|
1 // Copyright 2015 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 "ui/base/test/material_design_controller_test_api.h" | 5 #include "ash/test/material_design_controller_test_api.h" |
6 | 6 |
7 namespace ui { | 7 namespace ash { |
8 namespace test { | 8 namespace test { |
9 | 9 |
10 MaterialDesignControllerTestAPI::MaterialDesignControllerTestAPI( | 10 MaterialDesignControllerTestAPI::MaterialDesignControllerTestAPI(bool mode) |
11 MaterialDesignController::Mode mode) | |
12 : previous_mode_(MaterialDesignController::mode_), | 11 : previous_mode_(MaterialDesignController::mode_), |
13 previous_initialized_(MaterialDesignController::is_mode_initialized_) { | 12 previous_initialized_(MaterialDesignController::is_mode_initialized_) { |
14 MaterialDesignController::SetMode(mode); | 13 MaterialDesignController::SetMode(mode); |
15 } | 14 } |
16 | 15 |
17 MaterialDesignControllerTestAPI::~MaterialDesignControllerTestAPI() { | 16 MaterialDesignControllerTestAPI::~MaterialDesignControllerTestAPI() { |
18 MaterialDesignController::is_mode_initialized_ = previous_initialized_; | 17 MaterialDesignController::is_mode_initialized_ = previous_initialized_; |
19 MaterialDesignController::mode_ = previous_mode_; | 18 MaterialDesignController::mode_ = previous_mode_; |
oshima
2016/04/26 16:06:58
Are you going to allow a test to change mode in th
varkha
2016/04/27 21:00:09
This can be used by tests that want to set and res
oshima
2016/04/27 21:51:04
Since the flag will never change during runtime, I
varkha
2016/04/27 22:14:00
This is more for having pre-existing tests that we
varkha
2016/04/27 22:20:07
e.g. here - https://code.google.com/p/chromium/cod
| |
20 } | 19 } |
21 | 20 |
21 // static | |
22 bool MaterialDesignControllerTestAPI::DefaultMode() { | |
23 return MaterialDesignController::DefaultMode(); | |
24 } | |
25 | |
26 // static | |
22 void MaterialDesignControllerTestAPI::Uninitialize() { | 27 void MaterialDesignControllerTestAPI::Uninitialize() { |
23 MaterialDesignController::Uninitialize(); | 28 MaterialDesignController::Uninitialize(); |
24 } | 29 } |
25 | 30 |
26 } // namespace test | 31 } // namespace test |
27 } // namespace ui | 32 } // namespace ash |
OLD | NEW |