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

Unified Diff: ui/aura/test/aura_test_base.h

Issue 2463823003: Runs most aura tests with both backends (Closed)
Patch Set: WindowEventDispatcherTestWithMessageLoop Created 4 years, 1 month 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
« no previous file with comments | « no previous file | ui/aura/test/aura_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/aura_test_base.h
diff --git a/ui/aura/test/aura_test_base.h b/ui/aura/test/aura_test_base.h
index 84e72893beca95c876292e57c8cbd5a5ef392450..a76aa170ad55e28da77c0f53610d7652ad72309c 100644
--- a/ui/aura/test/aura_test_base.h
+++ b/ui/aura/test/aura_test_base.h
@@ -27,6 +27,8 @@ class WindowTreeClientDelegate;
namespace test {
+enum class BackendType { CLASSIC, MUS };
+
// A base class for aura unit tests.
// TODO(beng): Instances of this test will create and own a RootWindow.
class AuraTestBase : public testing::Test,
@@ -58,6 +60,10 @@ class AuraTestBase : public testing::Test,
// Turns on mus. Must be called before SetUp().
void EnableMus();
+ // Used to configure the backend. This is exposed to make parameterized tests
+ // easy to write. This *must* be called from SetUp().
+ void ConfigureBackend(BackendType type);
+
void RunAllPendingInMessageLoop();
void ParentWindow(Window* window);
@@ -128,6 +134,22 @@ class AuraTestBase : public testing::Test,
DISALLOW_COPY_AND_ASSIGN(AuraTestBase);
};
+// Use as a base class for tests that want to target both backends.
+class AuraTestBaseWithType : public AuraTestBase,
+ public ::testing::WithParamInterface<BackendType> {
+ public:
+ AuraTestBaseWithType();
+ ~AuraTestBaseWithType() override;
+
+ // AuraTestBase:
+ void SetUp() override;
+
+ private:
+ bool setup_called_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(AuraTestBaseWithType);
+};
+
} // namespace test
} // namespace aura
« no previous file with comments | « no previous file | ui/aura/test/aura_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698