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"
13 class MessageLoopForUI
;
19 class ScopedAnimationDurationScaleMode
;
32 class InputMethodEventFilter
;
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
{
43 explicit AthenaTestHelper(base::MessageLoopForUI
* message_loop
);
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
53 // Flushes message loop.
54 void RunAllPendingInMessageLoop();
56 aura::Window
* GetRootWindow();
57 aura::WindowTreeHost
* GetHost();
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
);
74 #endif // ATHENA_TEST_BASE_ATHENA_TEST_HELPER_H_