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

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 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 #include "base/logging.h"
sky 2016/04/13 23:49:58 Do you really need this include?
varkha 2016/04/14 00:03:33 Obviously not, somehow erasing LOGs wasn't enough.
8
7 namespace ui { 9 namespace ui {
8 namespace test { 10 namespace test {
9 11
10 void MaterialDesignControllerTestAPI::SetMode( 12 MaterialDesignControllerTestAPI::MaterialDesignControllerTestAPI(
11 MaterialDesignController::Mode mode) { 13 MaterialDesignController::Mode mode)
14 : previous_mode_(MaterialDesignController::mode_),
15 previous_initialized_(MaterialDesignController::is_mode_initialized_) {
12 MaterialDesignController::SetMode(mode); 16 MaterialDesignController::SetMode(mode);
13 } 17 }
14 18
15 void MaterialDesignControllerTestAPI::UninitializeMode() { 19 MaterialDesignControllerTestAPI::~MaterialDesignControllerTestAPI() {
16 MaterialDesignController::UninitializeMode(); 20 MaterialDesignController::is_mode_initialized_ = previous_initialized_;
21 MaterialDesignController::mode_ = previous_mode_;
22 }
23
24 void MaterialDesignControllerTestAPI::Uninitialize() {
25 MaterialDesignController::Uninitialize();
17 } 26 }
18 27
19 } // namespace test 28 } // namespace test
20 } // namespace ui 29 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698