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

Unified Diff: ui/base/test/material_design_controller_test_api.h

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 side-by-side diff with in-line comments
Download patch
Index: ui/base/test/material_design_controller_test_api.h
diff --git a/ui/base/test/material_design_controller_test_api.h b/ui/base/test/material_design_controller_test_api.h
index 96aab7b01711aced9513c327722e2c57d58115a2..3eb53a349f5585ad03e677b5e84478335a66b271 100644
--- a/ui/base/test/material_design_controller_test_api.h
+++ b/ui/base/test/material_design_controller_test_api.h
@@ -12,17 +12,24 @@ namespace ui {
namespace test {
// Test API to access the internal state of the MaterialDesignController class.
+// Creating an instance of this class and then destroying it preserves global
+// state in MaterialDesignController class.
class MaterialDesignControllerTestAPI {
public:
+ explicit MaterialDesignControllerTestAPI(MaterialDesignController::Mode mode);
+ ~MaterialDesignControllerTestAPI();
+
// Wrapper functions for MaterialDesignController internal functions.
- static void SetMode(MaterialDesignController::Mode mode);
- static void UninitializeMode();
+ static void Uninitialize();
private:
+ const MaterialDesignController::Mode previous_mode_;
+ const bool previous_initialized_;
+
DISALLOW_COPY_AND_ASSIGN(MaterialDesignControllerTestAPI);
};
} // namespace test
} // namespace ui
-#endif // UI_BASE_TEST_MATERIAL_DESIGN_CONTROLLER_TEST_AP_H_
+#endif // UI_BASE_TEST_MATERIAL_DESIGN_CONTROLLER_TEST_API_H_
« no previous file with comments | « ui/base/material_design/material_design_controller_unittest.cc ('k') | ui/base/test/material_design_controller_test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698