| 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 "base/files/scoped_temp_dir.h" | 5 #include "base/files/scoped_temp_dir.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/strings/string_split.h" | 7 #include "base/strings/string_split.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 EXPECT_EQ(expected->show_in_default_list, actual->show_in_default_list); | 39 EXPECT_EQ(expected->show_in_default_list, actual->show_in_default_list); |
| 40 EXPECT_EQ(expected->safe_for_autoreplace, actual->safe_for_autoreplace); | 40 EXPECT_EQ(expected->safe_for_autoreplace, actual->safe_for_autoreplace); |
| 41 EXPECT_EQ(expected->input_encodings, actual->input_encodings); | 41 EXPECT_EQ(expected->input_encodings, actual->input_encodings); |
| 42 EXPECT_EQ(expected->search_terms_replacement_key, | 42 EXPECT_EQ(expected->search_terms_replacement_key, |
| 43 actual->search_terms_replacement_key); | 43 actual->search_terms_replacement_key); |
| 44 } | 44 } |
| 45 | 45 |
| 46 // TODO(caitkp): TemplateURLData-ify this. | 46 // TODO(caitkp): TemplateURLData-ify this. |
| 47 void SetOverrides(user_prefs::TestingPrefServiceSyncable* prefs, bool update) { | 47 void SetOverrides(user_prefs::TestingPrefServiceSyncable* prefs, bool update) { |
| 48 prefs->SetUserPref(prefs::kSearchProviderOverridesVersion, | 48 prefs->SetUserPref(prefs::kSearchProviderOverridesVersion, |
| 49 base::Value::CreateIntegerValue(1)); | 49 new base::FundamentalValue(1)); |
| 50 base::ListValue* overrides = new base::ListValue; | 50 base::ListValue* overrides = new base::ListValue; |
| 51 scoped_ptr<base::DictionaryValue> entry(new base::DictionaryValue); | 51 scoped_ptr<base::DictionaryValue> entry(new base::DictionaryValue); |
| 52 | 52 |
| 53 entry->SetString("name", update ? "new_foo" : "foo"); | 53 entry->SetString("name", update ? "new_foo" : "foo"); |
| 54 entry->SetString("keyword", update ? "new_fook" : "fook"); | 54 entry->SetString("keyword", update ? "new_fook" : "fook"); |
| 55 entry->SetString("search_url", "http://foo.com/s?q={searchTerms}"); | 55 entry->SetString("search_url", "http://foo.com/s?q={searchTerms}"); |
| 56 entry->SetString("favicon_url", "http://foi.com/favicon.ico"); | 56 entry->SetString("favicon_url", "http://foi.com/favicon.ico"); |
| 57 entry->SetString("encoding", "UTF-8"); | 57 entry->SetString("encoding", "UTF-8"); |
| 58 entry->SetInteger("id", 1001); | 58 entry->SetInteger("id", 1001); |
| 59 entry->SetString("suggest_url", "http://foo.com/suggest?q={searchTerms}"); | 59 entry->SetString("suggest_url", "http://foo.com/suggest?q={searchTerms}"); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 ExpectSimilar(extension_data_3.get(), | 316 ExpectSimilar(extension_data_3.get(), |
| 317 manager.GetDefaultSearchEngine(&source)); | 317 manager.GetDefaultSearchEngine(&source)); |
| 318 EXPECT_EQ(DefaultSearchManager::FROM_EXTENSION, source); | 318 EXPECT_EQ(DefaultSearchManager::FROM_EXTENSION, source); |
| 319 | 319 |
| 320 manager.ClearExtensionControlledDefaultSearchEngine(); | 320 manager.ClearExtensionControlledDefaultSearchEngine(); |
| 321 | 321 |
| 322 ExpectSimilar(data.get(), manager.GetDefaultSearchEngine(&source)); | 322 ExpectSimilar(data.get(), manager.GetDefaultSearchEngine(&source)); |
| 323 EXPECT_EQ(DefaultSearchManager::FROM_USER, source); | 323 EXPECT_EQ(DefaultSearchManager::FROM_USER, source); |
| 324 } | 324 } |
| OLD | NEW |