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

Side by Side Diff: views/test/views_test_base.h

Issue 8194004: change the way windows are parented when their parent is set to NULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef VIEWS_TEST_VIEWS_TEST_BASE_H_ 5 #ifndef VIEWS_TEST_VIEWS_TEST_BASE_H_
6 #define VIEWS_TEST_VIEWS_TEST_BASE_H_ 6 #define VIEWS_TEST_VIEWS_TEST_BASE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "views/test/test_views_delegate.h" 13 #include "views/test/test_views_delegate.h"
14 14
15 #if defined(USE_AURA)
16 #include "ui/aura/test_desktop_delegate.h"
17 #endif
18
15 namespace views { 19 namespace views {
16 20
17 class TestViewsDelegate; 21 class TestViewsDelegate;
18 22
19 // A base class for views unit test. It creates a message loop necessary 23 // A base class for views unit test. It creates a message loop necessary
20 // to drive UI events and takes care of OLE initialization for windows. 24 // to drive UI events and takes care of OLE initialization for windows.
21 class ViewsTestBase : public testing::Test { 25 class ViewsTestBase : public testing::Test {
22 public: 26 public:
23 ViewsTestBase(); 27 ViewsTestBase();
24 virtual ~ViewsTestBase(); 28 virtual ~ViewsTestBase();
25 29
26 // testing::Test: 30 // testing::Test:
27 virtual void SetUp() OVERRIDE; 31 virtual void SetUp() OVERRIDE;
28 virtual void TearDown() OVERRIDE; 32 virtual void TearDown() OVERRIDE;
29 33
30 void RunPendingMessages(); 34 void RunPendingMessages();
31 35
32 protected: 36 protected:
33 TestViewsDelegate& views_delegate() const { return *views_delegate_.get(); } 37 TestViewsDelegate& views_delegate() const { return *views_delegate_.get(); }
34 38
35 void set_views_delegate(TestViewsDelegate* views_delegate) { 39 void set_views_delegate(TestViewsDelegate* views_delegate) {
36 views_delegate_.reset(views_delegate); 40 views_delegate_.reset(views_delegate);
37 } 41 }
38 42
39 private: 43 private:
40 MessageLoopForUI message_loop_; 44 MessageLoopForUI message_loop_;
41 scoped_ptr<TestViewsDelegate> views_delegate_; 45 scoped_ptr<TestViewsDelegate> views_delegate_;
42 bool setup_called_; 46 bool setup_called_;
43 bool teardown_called_; 47 bool teardown_called_;
48 #if defined(USE_AURA)
49 aura::TestDesktopDelegate desktop_delegate_;
50 #endif
44 51
45 DISALLOW_COPY_AND_ASSIGN(ViewsTestBase); 52 DISALLOW_COPY_AND_ASSIGN(ViewsTestBase);
46 }; 53 };
47 54
48 } // namespace views 55 } // namespace views
49 56
50 #endif // VIEWS_TEST_VIEWS_TEST_BASE_H_ 57 #endif // VIEWS_TEST_VIEWS_TEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698