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_PROFILE_TEST_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PROFILE_TEST_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" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 12 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
13 #include "chrome/test/base/testing_browser_process.h" | 13 #include "chrome/test/base/testing_browser_process.h" |
14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
15 #include "chrome/test/base/testing_profile_manager.h" | 15 #include "chrome/test/base/testing_profile_manager.h" |
16 #include "content/test/test_browser_thread.h" | 16 #include "content/public/test/test_browser_thread.h" |
17 | 17 |
18 // Base class which contains a valid Browser*. Lots of boilerplate to | 18 // Base class which contains a valid Browser*. Lots of boilerplate to |
19 // recycle between unit test classes. | 19 // recycle between unit test classes. |
20 // | 20 // |
21 // This class creates fake UI, file, and IO threads because many objects that | 21 // This class creates fake UI, file, and IO threads because many objects that |
22 // are attached to the TestingProfile (and other objects) have traits that limit | 22 // are attached to the TestingProfile (and other objects) have traits that limit |
23 // their destruction to certain threads. For example, the net::URLRequestContext | 23 // their destruction to certain threads. For example, the net::URLRequestContext |
24 // can only be deleted on the IO thread; without this fake IO thread, the object | 24 // can only be deleted on the IO thread; without this fake IO thread, the object |
25 // would never be deleted and would report as a leak under Valgrind. Note that | 25 // would never be deleted and would report as a leak under Valgrind. Note that |
26 // these are fake threads and they all share the same MessageLoop. | 26 // these are fake threads and they all share the same MessageLoop. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 TestingProfileManager profile_manager_; | 64 TestingProfileManager profile_manager_; |
65 TestingProfile* profile_; // Weak; owned by profile_manager_. | 65 TestingProfile* profile_; // Weak; owned by profile_manager_. |
66 scoped_ptr<Browser> browser_; | 66 scoped_ptr<Browser> browser_; |
67 | 67 |
68 scoped_ptr<content::TestBrowserThread> file_user_blocking_thread_; | 68 scoped_ptr<content::TestBrowserThread> file_user_blocking_thread_; |
69 scoped_ptr<content::TestBrowserThread> file_thread_; | 69 scoped_ptr<content::TestBrowserThread> file_thread_; |
70 scoped_ptr<content::TestBrowserThread> io_thread_; | 70 scoped_ptr<content::TestBrowserThread> io_thread_; |
71 }; | 71 }; |
72 | 72 |
73 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ | 73 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ |
OLD | NEW |