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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
26 #include "chrome/test/base/testing_pref_service.h" | 26 #include "chrome/test/base/testing_pref_service.h" |
27 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
28 #include "content/public/browser/notification_details.h" | 28 #include "content/public/browser/notification_details.h" |
29 #include "content/public/browser/notification_source.h" | 29 #include "content/public/browser/notification_source.h" |
30 #include "content/test/test_browser_thread.h" | 30 #include "content/test/test_browser_thread.h" |
31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
32 | 32 |
33 using base::Time; | 33 using base::Time; |
34 using base::TimeDelta; | 34 using base::TimeDelta; |
| 35 using content::BrowserThread; |
35 using ::testing::Return; | 36 using ::testing::Return; |
36 using ::testing::StrictMock; | 37 using ::testing::StrictMock; |
37 | 38 |
38 // Test the GenerateSearchURL on a thread or the main thread. | 39 // Test the GenerateSearchURL on a thread or the main thread. |
39 class TestGenerateSearchURL | 40 class TestGenerateSearchURL |
40 : public base::RefCountedThreadSafe<TestGenerateSearchURL> { | 41 : public base::RefCountedThreadSafe<TestGenerateSearchURL> { |
41 public: | 42 public: |
42 explicit TestGenerateSearchURL(SearchTermsData* search_terms_data) | 43 explicit TestGenerateSearchURL(SearchTermsData* search_terms_data) |
43 : search_terms_data_(search_terms_data), | 44 : search_terms_data_(search_terms_data), |
44 passed_(false) { | 45 passed_(false) { |
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 model()->SetDefaultSearchProvider(t_url); | 1241 model()->SetDefaultSearchProvider(t_url); |
1241 EXPECT_EQ(t_url, model()->GetDefaultSearchProvider()); | 1242 EXPECT_EQ(t_url, model()->GetDefaultSearchProvider()); |
1242 | 1243 |
1243 // Now reset the model again but load it after setting the preferences. | 1244 // Now reset the model again but load it after setting the preferences. |
1244 ResetModel(false); | 1245 ResetModel(false); |
1245 SetManagedDefaultSearchPreferences(false, "", "", "", "", "", ""); | 1246 SetManagedDefaultSearchPreferences(false, "", "", "", "", "", ""); |
1246 VerifyLoad(); | 1247 VerifyLoad(); |
1247 EXPECT_TRUE(model()->is_default_search_managed()); | 1248 EXPECT_TRUE(model()->is_default_search_managed()); |
1248 EXPECT_TRUE(model()->GetDefaultSearchProvider() == NULL); | 1249 EXPECT_TRUE(model()->GetDefaultSearchProvider() == NULL); |
1249 } | 1250 } |
OLD | NEW |