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

Unified Diff: services/ui/view_manager/tests/view_manager_test_base.h

Issue 1949233002: Create a RegisterViewAssociate method in ViewManager (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add tests to mojo tests Created 4 years, 7 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: services/ui/view_manager/tests/view_manager_test_base.h
diff --git a/services/ui/view_manager/tests/view_manager_test_base.h b/services/ui/view_manager/tests/view_manager_test_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..4198be4ff8ebb12c467c95888fc058d66c73e27a
--- /dev/null
+++ b/services/ui/view_manager/tests/view_manager_test_base.h
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/bind.h"
+#include "mojo/public/cpp/application/application_test_base.h"
+
+namespace view_manager {
+namespace test {
+
+const base::TimeDelta kDefaultMessageDelay =
+ base::TimeDelta::FromMilliseconds(10);
+
+// Run message loop until condition is true (timeout after 400*10ms = 4000ms)
+#define KICK_MESSAGE_LOOP_WHILE(x) \
+ for (int i = 0; x && i < 400; i++) { \
+ KickMessageLoop(); \
+ }
+
+class ViewManagerTestBase : public mojo::test::ApplicationTestBase {
+ public:
+ ViewManagerTestBase();
+ ~ViewManagerTestBase() override;
+
+ void SetUp() override;
+ void KickMessageLoop();
+
+ protected:
+ base::Closure quit_message_loop_callback_;
+ base::WeakPtrFactory<ViewManagerTestBase> weak_factory_;
+
+ private:
+ void QuitMessageLoopCallback();
+
+ DISALLOW_COPY_AND_ASSIGN(ViewManagerTestBase);
+};
+
+} // namespace test
+} // namespace view_manager
« no previous file with comments | « services/ui/view_manager/tests/view_manager_test.cc ('k') | services/ui/view_manager/tests/view_manager_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698