| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 data->suggestions_url = std::string("http://").append(type).append("sugg"); | 130 data->suggestions_url = std::string("http://").append(type).append("sugg"); |
| 131 data->alternate_urls.push_back( | 131 data->alternate_urls.push_back( |
| 132 std::string("http://").append(type).append("foo/alt")); | 132 std::string("http://").append(type).append("foo/alt")); |
| 133 data->favicon_url = GURL("http://icon1"); | 133 data->favicon_url = GURL("http://icon1"); |
| 134 data->safe_for_autoreplace = true; | 134 data->safe_for_autoreplace = true; |
| 135 data->show_in_default_list = true; | 135 data->show_in_default_list = true; |
| 136 data->input_encodings = base::SplitString( | 136 data->input_encodings = base::SplitString( |
| 137 "UTF-8;UTF-16", ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 137 "UTF-8;UTF-16", ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 138 data->date_created = base::Time(); | 138 data->date_created = base::Time(); |
| 139 data->last_modified = base::Time(); | 139 data->last_modified = base::Time(); |
| 140 return data.Pass(); | 140 return data; |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace | 143 } // namespace |
| 144 | 144 |
| 145 class DefaultSearchManagerTest : public testing::Test { | 145 class DefaultSearchManagerTest : public testing::Test { |
| 146 public: | 146 public: |
| 147 DefaultSearchManagerTest() {}; | 147 DefaultSearchManagerTest() {}; |
| 148 | 148 |
| 149 void SetUp() override { | 149 void SetUp() override { |
| 150 pref_service_.reset(new user_prefs::TestingPrefServiceSyncable); | 150 pref_service_.reset(new user_prefs::TestingPrefServiceSyncable); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 321 |
| 322 ExpectSimilar(extension_data_3.get(), | 322 ExpectSimilar(extension_data_3.get(), |
| 323 manager.GetDefaultSearchEngine(&source)); | 323 manager.GetDefaultSearchEngine(&source)); |
| 324 EXPECT_EQ(DefaultSearchManager::FROM_EXTENSION, source); | 324 EXPECT_EQ(DefaultSearchManager::FROM_EXTENSION, source); |
| 325 | 325 |
| 326 manager.ClearExtensionControlledDefaultSearchEngine(); | 326 manager.ClearExtensionControlledDefaultSearchEngine(); |
| 327 | 327 |
| 328 ExpectSimilar(data.get(), manager.GetDefaultSearchEngine(&source)); | 328 ExpectSimilar(data.get(), manager.GetDefaultSearchEngine(&source)); |
| 329 EXPECT_EQ(DefaultSearchManager::FROM_USER, source); | 329 EXPECT_EQ(DefaultSearchManager::FROM_USER, source); |
| 330 } | 330 } |
| OLD | NEW |