OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_UI_COCOA_BROWSER_TEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_TEST_HELPER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_TEST_HELPER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_TEST_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/browser_thread.h" | 9 #include "chrome/browser/browser_thread.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/test/testing_profile.h" | 12 #include "chrome/test/testing_profile.h" |
13 | 13 |
14 // Base class which contains a valid Browser*. Lots of boilerplate to | 14 // Base class which contains a valid Browser*. Lots of boilerplate to |
15 // recycle between unit test classes. | 15 // recycle between unit test classes. |
16 // | 16 // |
17 // This class creates fake UI, file, and IO threads because many objects that | 17 // This class creates fake UI, file, and IO threads because many objects that |
18 // are attached to the TestingProfile (and other objects) have traits that limit | 18 // are attached to the TestingProfile (and other objects) have traits that limit |
19 // their destruction to certain threads. For example, the URLRequestContext can | 19 // their destruction to certain threads. For example, the URLRequestContext can |
20 // only be deleted on the IO thread; without this fake IO thread, the object | 20 // only be deleted on the IO thread; without this fake IO thread, the object |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 private: | 83 private: |
84 scoped_ptr<TestingProfile> profile_; | 84 scoped_ptr<TestingProfile> profile_; |
85 scoped_ptr<Browser> browser_; | 85 scoped_ptr<Browser> browser_; |
86 MessageLoopForUI message_loop_; | 86 MessageLoopForUI message_loop_; |
87 BrowserThread ui_thread_; | 87 BrowserThread ui_thread_; |
88 scoped_ptr<BrowserThread> file_thread_; | 88 scoped_ptr<BrowserThread> file_thread_; |
89 scoped_ptr<BrowserThread> io_thread_; | 89 scoped_ptr<BrowserThread> io_thread_; |
90 }; | 90 }; |
91 | 91 |
92 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_TEST_HELPER_H_ | 92 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_TEST_HELPER_H_ |
OLD | NEW |