Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: components/search_engines/template_url_service_sync_unittest.cc

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/memory/scoped_vector.h" 6 #include "base/memory/scoped_vector.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 sync_pb::SearchEngineSpecifics* se_specifics = 61 sync_pb::SearchEngineSpecifics* se_specifics =
62 specifics.mutable_search_engine(); 62 specifics.mutable_search_engine();
63 se_specifics->set_short_name(base::UTF16ToUTF8(turl.short_name())); 63 se_specifics->set_short_name(base::UTF16ToUTF8(turl.short_name()));
64 se_specifics->set_keyword( 64 se_specifics->set_keyword(
65 autogenerate_keyword ? std::string() : base::UTF16ToUTF8(turl.keyword())); 65 autogenerate_keyword ? std::string() : base::UTF16ToUTF8(turl.keyword()));
66 se_specifics->set_favicon_url(turl.favicon_url().spec()); 66 se_specifics->set_favicon_url(turl.favicon_url().spec());
67 se_specifics->set_url(url); 67 se_specifics->set_url(url);
68 se_specifics->set_safe_for_autoreplace(turl.safe_for_autoreplace()); 68 se_specifics->set_safe_for_autoreplace(turl.safe_for_autoreplace());
69 se_specifics->set_originating_url(turl.originating_url().spec()); 69 se_specifics->set_originating_url(turl.originating_url().spec());
70 se_specifics->set_date_created(turl.date_created().ToInternalValue()); 70 se_specifics->set_date_created(turl.date_created().ToInternalValue());
71 se_specifics->set_input_encodings(JoinString(turl.input_encodings(), ';')); 71 se_specifics->set_input_encodings(
72 base::JoinString(turl.input_encodings(), ";"));
72 se_specifics->set_show_in_default_list(turl.show_in_default_list()); 73 se_specifics->set_show_in_default_list(turl.show_in_default_list());
73 se_specifics->set_suggestions_url(turl.suggestions_url()); 74 se_specifics->set_suggestions_url(turl.suggestions_url());
74 se_specifics->set_prepopulate_id(turl.prepopulate_id()); 75 se_specifics->set_prepopulate_id(turl.prepopulate_id());
75 se_specifics->set_autogenerate_keyword(autogenerate_keyword); 76 se_specifics->set_autogenerate_keyword(autogenerate_keyword);
76 se_specifics->set_instant_url(turl.instant_url()); 77 se_specifics->set_instant_url(turl.instant_url());
77 se_specifics->set_last_modified(turl.last_modified().ToInternalValue()); 78 se_specifics->set_last_modified(turl.last_modified().ToInternalValue());
78 se_specifics->set_sync_guid(sync_guid); 79 se_specifics->set_sync_guid(sync_guid);
79 return syncer::SyncData::CreateLocalData(turl.sync_guid(), // Must be valid! 80 return syncer::SyncData::CreateLocalData(turl.sync_guid(), // Must be valid!
80 se_specifics->keyword(), specifics); 81 se_specifics->keyword(), specifics);
81 } 82 }
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after
2260 const char kNewGUID[] = "newdefault"; 2261 const char kNewGUID[] = "newdefault";
2261 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("what"), 2262 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("what"),
2262 "http://thewhat.com/{searchTerms}", 2263 "http://thewhat.com/{searchTerms}",
2263 kNewGUID)); 2264 kNewGUID));
2264 model()->SetUserSelectedDefaultSearchProvider( 2265 model()->SetUserSelectedDefaultSearchProvider(
2265 model()->GetTemplateURLForGUID(kNewGUID)); 2266 model()->GetTemplateURLForGUID(kNewGUID));
2266 2267
2267 EXPECT_EQ(kNewGUID, profile_a()->GetTestingPrefService()->GetString( 2268 EXPECT_EQ(kNewGUID, profile_a()->GetTestingPrefService()->GetString(
2268 prefs::kSyncedDefaultSearchProviderGUID)); 2269 prefs::kSyncedDefaultSearchProviderGUID));
2269 } 2270 }
OLDNEW
« no previous file with comments | « components/search_engines/template_url_service.cc ('k') | components/signin/core/browser/gaia_cookie_manager_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698