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

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 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..403b7dbe44bdafc53870b626a210a2811e029203 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:
+ MaterialDesignControllerTestAPI(MaterialDesignController::Mode mode);
sky 2016/04/13 23:49:58 explicit.
varkha 2016/04/14 00:03:33 Done.
+ ~MaterialDesignControllerTestAPI();
+
// Wrapper functions for MaterialDesignController internal functions.
- static void SetMode(MaterialDesignController::Mode mode);
- static void UninitializeMode();
+ static void Uninitialize();
private:
+ MaterialDesignController::Mode previous_mode_;
sky 2016/04/13 23:49:58 nit: const on this and the next.
varkha 2016/04/14 00:03:33 Done.
+ 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_

Powered by Google App Engine
This is Rietveld 408576698