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_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_TEST_UTIL_H_ |
6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_TEST_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/string16.h" | 15 #include "base/string16.h" |
16 #include "chrome/browser/search_engines/template_url_service_observer.h" | 16 #include "chrome/browser/search_engines/template_url_service_observer.h" |
| 17 #include "chrome/test/testing_browser_process.h" |
17 #include "content/browser/browser_thread.h" | 18 #include "content/browser/browser_thread.h" |
18 | 19 |
19 class TemplateURLService; | 20 class TemplateURLService; |
20 class TemplateURLServiceTestingProfile; | 21 class TemplateURLServiceTestingProfile; |
21 class TestingTemplateURLService; | 22 class TestingTemplateURLService; |
22 class TestingProfile; | 23 class TestingProfile; |
23 class WebDataService; | 24 class WebDataService; |
24 | 25 |
25 // Implements functionality to make it easier to test TemplateURLService and | 26 // Implements functionality to make it easier to test TemplateURLService and |
26 // make changes to it. | 27 // make changes to it. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Returns the TemplateURLService. | 83 // Returns the TemplateURLService. |
83 TemplateURLService* model() const; | 84 TemplateURLService* model() const; |
84 | 85 |
85 // Returns the TestingProfile. | 86 // Returns the TestingProfile. |
86 TestingProfile* profile() const; | 87 TestingProfile* profile() const; |
87 | 88 |
88 // Starts an I/O thread. | 89 // Starts an I/O thread. |
89 void StartIOThread(); | 90 void StartIOThread(); |
90 | 91 |
91 private: | 92 private: |
| 93 ScopedTestingBrowserProcess browser_process_; |
| 94 |
92 MessageLoopForUI message_loop_; | 95 MessageLoopForUI message_loop_; |
93 // Needed to make the DeleteOnUIThread trait of WebDataService work | 96 // Needed to make the DeleteOnUIThread trait of WebDataService work |
94 // properly. | 97 // properly. |
95 BrowserThread ui_thread_; | 98 BrowserThread ui_thread_; |
96 scoped_ptr<TemplateURLServiceTestingProfile> profile_; | 99 scoped_ptr<TemplateURLServiceTestingProfile> profile_; |
97 scoped_ptr<TestingTemplateURLService> model_; | 100 scoped_ptr<TestingTemplateURLService> model_; |
98 int changed_count_; | 101 int changed_count_; |
99 | 102 |
100 DISALLOW_COPY_AND_ASSIGN(TemplateURLServiceTestUtil); | 103 DISALLOW_COPY_AND_ASSIGN(TemplateURLServiceTestUtil); |
101 }; | 104 }; |
102 | 105 |
103 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_TEST_UTIL_H_ | 106 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_TEST_UTIL_H_ |
OLD | NEW |