aura_test_base.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
1// Copyright (c) 2012 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#ifndef UI_AURA_TEST_AURA_TEST_BASE_H_
6#define UI_AURA_TEST_AURA_TEST_BASE_H_
7
8#include "base/compiler_specific.h"
9#include "base/basictypes.h"
10#include "base/message_loop.h"
11#include "testing/gtest/include/gtest/gtest.h"
12#include "ui/aura/test/aura_test_helper.h"
13
14namespace aura {
15class RootWindow;
16namespace test {
17
18// A base class for aura unit tests.
19// TODO(beng): Instances of this test will create and own a RootWindow.
20class AuraTestBase : public testing::Test {
21 public:
22  AuraTestBase();
23  virtual ~AuraTestBase();
24
25  // testing::Test:
26  virtual void SetUp() OVERRIDE;
27  virtual void TearDown() OVERRIDE;
28
29 protected:
30  void RunAllPendingInMessageLoop();
31
32  RootWindow* root_window() { return helper_->root_window(); }
33
34 private:
35  MessageLoopForUI message_loop_;
36  scoped_ptr<AuraTestHelper> helper_;
37
38  DISALLOW_COPY_AND_ASSIGN(AuraTestBase);
39};
40
41}  // namespace test
42}  // namespace aura
43
44#endif  // UI_AURA_TEST_AURA_TEST_BASE_H_
45