Roll src/third_party/WebKit f007c95:0171005 (svn 185074:185088)
[chromium-blink-merge.git] / athena / test / base / athena_test_helper.h
blob2623a95ee9fc6ea1485a19231b3e30cb79ffe8c4
1 // Copyright 2014 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.
5 #ifndef ATHENA_TEST_BASE_ATHENA_TEST_HELPER_H_
6 #define ATHENA_TEST_BASE_ATHENA_TEST_HELPER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/aura/window_tree_host.h"
12 namespace base {
13 class MessageLoopForUI;
14 class Thread;
17 namespace ui {
18 class ContextFactory;
19 class ScopedAnimationDurationScaleMode;
22 namespace aura {
23 class Window;
24 class TestScreen;
25 class WindowTreeHost;
26 namespace client {
27 class FocusClient;
31 namespace wm {
32 class InputMethodEventFilter;
35 namespace athena {
36 namespace test {
38 // A helper class owned by tests that does common initialization required for
39 // Athena use. This class creates a root window with clients and other objects
40 // that are necessary to run test on Athena.
41 class AthenaTestHelper {
42 public:
43 explicit AthenaTestHelper(base::MessageLoopForUI* message_loop);
44 ~AthenaTestHelper();
46 // Creates and initializes (shows and sizes) the RootWindow for use in tests.
47 void SetUp(ui::ContextFactory* context_factory);
49 // Clean up objects that are created for tests. This also deletes the Env
50 // object.
51 void TearDown();
53 // Flushes message loop.
54 void RunAllPendingInMessageLoop();
56 aura::Window* GetRootWindow();
57 aura::WindowTreeHost* GetHost();
59 private:
60 bool setup_called_;
61 bool teardown_called_;
63 base::MessageLoopForUI* message_loop_;
65 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
66 scoped_ptr<base::Thread> file_thread_;
68 DISALLOW_COPY_AND_ASSIGN(AthenaTestHelper);
71 } // namespace test
72 } // namespace athena
74 #endif // ATHENA_TEST_BASE_ATHENA_TEST_HELPER_H_