OLD | NEW |
(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 |
OLD | NEW |