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_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/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/test/base/testing_browser_process.h" |
10 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" |
11 #include "chrome/test/testing_browser_process.h" | |
12 #include "content/browser/browser_thread.h" | 12 #include "content/browser/browser_thread.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 net::URLRequestContext | 19 // their destruction to certain threads. For example, the net::URLRequestContext |
20 // can only be deleted on the IO thread; without this fake IO thread, the object | 20 // can only be deleted on the IO thread; without this fake IO thread, the object |
21 // would never be deleted and would report as a leak under Valgrind. Note that | 21 // would never be deleted and would report as a leak under Valgrind. Note that |
(...skipping 24 matching lines...) Expand all Loading... |
46 | 46 |
47 scoped_ptr<TestingProfile> profile_; | 47 scoped_ptr<TestingProfile> profile_; |
48 scoped_ptr<Browser> browser_; | 48 scoped_ptr<Browser> browser_; |
49 MessageLoopForUI message_loop_; | 49 MessageLoopForUI message_loop_; |
50 BrowserThread ui_thread_; | 50 BrowserThread ui_thread_; |
51 scoped_ptr<BrowserThread> file_thread_; | 51 scoped_ptr<BrowserThread> file_thread_; |
52 scoped_ptr<BrowserThread> io_thread_; | 52 scoped_ptr<BrowserThread> io_thread_; |
53 }; | 53 }; |
54 | 54 |
55 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_TEST_HELPER_H_ | 55 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_TEST_HELPER_H_ |
OLD | NEW |