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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/bind.h"
6 #include "mojo/public/cpp/application/application_test_base.h"
7
8 namespace view_manager {
9 namespace test {
10
11 const base::TimeDelta kDefaultMessageDelay =
12 base::TimeDelta::FromMilliseconds(10);
13
14 // Run message loop until condition is true (timeout after 400*10ms = 4000ms)
15 #define KICK_MESSAGE_LOOP_WHILE(x) \
16 for (int i = 0; x && i < 400; i++) { \
17 KickMessageLoop(); \
18 }
19
20 class ViewManagerTestBase : public mojo::test::ApplicationTestBase {
21 public:
22 ViewManagerTestBase();
23 ~ViewManagerTestBase() override;
24
25 void SetUp() override;
26 void KickMessageLoop();
27
28 protected:
29 base::Closure quit_message_loop_callback_;
30 base::WeakPtrFactory<ViewManagerTestBase> weak_factory_;
31
32 private:
33 void QuitMessageLoopCallback();
34
35 DISALLOW_COPY_AND_ASSIGN(ViewManagerTestBase);
36 };
37
38 } // namespace test
39 } // namespace view_manager
OLDNEW
« 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