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

Unified Diff: chrome/browser/sync/test/integration/search_engines_helper.cc

Issue 8571005: Add four new sync integration tests for custom search engines. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed -1 flag and used DisableVerifier instead. Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/search_engines_helper.cc
diff --git a/chrome/browser/sync/test/integration/search_engines_helper.cc b/chrome/browser/sync/test/integration/search_engines_helper.cc
index adc3ed77ae1a77d79e3b831f49fb73a0b6641c9b..af5eae928ba39b885f7cdae3ffc5b7b1d88173a8 100644
--- a/chrome/browser/sync/test/integration/search_engines_helper.cc
+++ b/chrome/browser/sync/test/integration/search_engines_helper.cc
@@ -86,7 +86,7 @@ bool ServiceMatchesVerifier(int profile) {
std::vector<const TemplateURL*> verifier_turls = verifier->GetTemplateURLs();
if (verifier_turls.size() != other->GetTemplateURLs().size()) {
- LOG(ERROR) << "verifier and other service have a different count of TURLs: "
+ LOG(ERROR) << "Verifier and other service have a different count of TURLs: "
<< verifier_turls.size() << " vs "
<< other->GetTemplateURLs().size() << " respectively.";
return false;
@@ -156,8 +156,10 @@ bool ServicesMatch(int profile_a, int profile_b) {
bool AllServicesMatch() {
// Use 0 as the baseline.
- if (!ServiceMatchesVerifier(0))
+ if (test()->use_verifier() && !ServiceMatchesVerifier(0)) {
+ LOG(ERROR) << "TemplateURLService 0 does not match verifier.";
return false;
+ }
for (int it = 0; it < test()->num_clients(); ++it) {
Raghu Simha 2011/11/16 19:44:43 |it| can be initialized to 1, since there's no poi
SteveT 2011/11/16 21:25:38 Done.
if (!ServicesMatch(0, it)) {
@@ -241,15 +243,15 @@ void DeleteSearchEngineBySeed(int profile, int seed) {
void ChangeDefaultSearchProvider(int profile, int seed) {
TemplateURLService* service = GetServiceForProfile(profile);
ASSERT_TRUE(service);
- const TemplateURL* new_default = service->GetTemplateURLForKeyword(
+ const TemplateURL* turl = service->GetTemplateURLForKeyword(
CreateKeyword(seed));
- ASSERT_TRUE(new_default);
- service->SetDefaultSearchProvider(new_default);
+ ASSERT_TRUE(turl);
+ service->SetDefaultSearchProvider(turl);
if (test()->use_verifier()) {
- new_default = GetVerifierService()->GetTemplateURLForKeyword(
- CreateKeyword(seed));
- ASSERT_TRUE(new_default);
- GetVerifierService()->SetDefaultSearchProvider(new_default);
+ const TemplateURL* verifier_turl =
+ GetVerifierService()->GetTemplateURLForKeyword(CreateKeyword(seed));
+ ASSERT_TRUE(verifier_turl);
+ GetVerifierService()->SetDefaultSearchProvider(verifier_turl);
}
}

Powered by Google App Engine
This is Rietveld 408576698