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

Side by Side Diff: ui/base/test/material_design_controller_test_api.cc

Issue 1878973002: [reland] Makes MaterialDesignController initialization explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made it possible to restore MaterialDesignController state after each test case (nits) Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/base/test/material_design_controller_test_api.h"
6 6
7 namespace ui { 7 namespace ui {
8 namespace test { 8 namespace test {
9 9
10 void MaterialDesignControllerTestAPI::SetMode( 10 MaterialDesignControllerTestAPI::MaterialDesignControllerTestAPI(
11 MaterialDesignController::Mode mode) { 11 MaterialDesignController::Mode mode)
12 : previous_mode_(MaterialDesignController::mode_),
13 previous_initialized_(MaterialDesignController::is_mode_initialized_) {
12 MaterialDesignController::SetMode(mode); 14 MaterialDesignController::SetMode(mode);
13 } 15 }
14 16
15 void MaterialDesignControllerTestAPI::UninitializeMode() { 17 MaterialDesignControllerTestAPI::~MaterialDesignControllerTestAPI() {
16 MaterialDesignController::UninitializeMode(); 18 MaterialDesignController::is_mode_initialized_ = previous_initialized_;
19 MaterialDesignController::mode_ = previous_mode_;
20 }
21
22 void MaterialDesignControllerTestAPI::Uninitialize() {
23 MaterialDesignController::Uninitialize();
17 } 24 }
18 25
19 } // namespace test 26 } // namespace test
20 } // namespace ui 27 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/test/material_design_controller_test_api.h ('k') | ui/message_center/views/bounded_label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698