OLD | NEW |
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 CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_TEST_BASE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_TEST_BASE_H_ |
6 #define CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_TEST_BASE_H_ | 6 #define CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_TEST_BASE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 private: | 27 private: |
28 DISALLOW_COPY_AND_ASSIGN(ProviderDelegateMock); | 28 DISALLOW_COPY_AND_ASSIGN(ProviderDelegateMock); |
29 }; | 29 }; |
30 | 30 |
31 class AsynchronousPolicyTestBase : public testing::Test { | 31 class AsynchronousPolicyTestBase : public testing::Test { |
32 public: | 32 public: |
33 AsynchronousPolicyTestBase(); | 33 AsynchronousPolicyTestBase(); |
34 virtual ~AsynchronousPolicyTestBase(); | 34 virtual ~AsynchronousPolicyTestBase(); |
35 | 35 |
36 // testing::Test: | 36 // testing::Test: |
37 virtual void SetUp(); | |
38 virtual void TearDown(); | 37 virtual void TearDown(); |
39 | 38 |
40 protected: | 39 protected: |
41 MessageLoop loop_; | 40 // Create an actual IO loop (needed by FilePathWatcher). |
42 | 41 MessageLoopForIO loop_; |
43 // The mocks that are used in the test must outlive the scope of the test | |
44 // because they still get accessed in the RunAllPending of the TearDown. | |
45 scoped_ptr<ProviderDelegateMock> delegate_; | |
46 | 42 |
47 private: | 43 private: |
48 content::TestBrowserThread ui_thread_; | 44 content::TestBrowserThread ui_thread_; |
49 content::TestBrowserThread file_thread_; | 45 content::TestBrowserThread file_thread_; |
50 | 46 |
51 DISALLOW_COPY_AND_ASSIGN(AsynchronousPolicyTestBase); | 47 DISALLOW_COPY_AND_ASSIGN(AsynchronousPolicyTestBase); |
52 }; | 48 }; |
53 | 49 |
54 } // namespace policy | 50 } // namespace policy |
55 | 51 |
56 #endif // CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_TEST_BASE_H_ | 52 #endif // CHROME_BROWSER_POLICY_ASYNCHRONOUS_POLICY_TEST_BASE_H_ |
OLD | NEW |