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

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

Issue 9968016: Move the URL string from TemplateURLRef onto the owning TemplateURL. This will make it easier to m… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/search_engines_helper.cc
===================================================================
--- chrome/browser/sync/test/integration/search_engines_helper.cc (revision 130285)
+++ chrome/browser/sync/test/integration/search_engines_helper.cc (working copy)
@@ -47,27 +47,18 @@
std::string GetTURLInfoString(const TemplateURL* turl) {
DCHECK(turl);
- std::string shortname = UTF16ToASCII(turl->short_name());
- std::string keyword = UTF16ToASCII(turl->keyword());
- return StringPrintf("TemplateURL: shortname: %s keyword: %s url: %s",
- shortname.c_str(), keyword.c_str(),
- (turl->url() ? turl->url()->url().c_str() : "NULL"));
+ return "TemplateURL: shortname: " + UTF16ToASCII(turl->short_name()) +
+ " keyword: " + UTF16ToASCII(turl->keyword()) + " url: " + turl->url();
}
bool TURLsMatch(const TemplateURL* turl1, const TemplateURL* turl2) {
CHECK(turl1);
CHECK(turl2);
- // Either both TemplateURLRefs are NULL or they're both valid and have the
- // same raw URL value.
- bool urls_match = ((!turl1->url() && !turl1->url()) ||
- (turl1->url() && turl2->url() &&
- turl1->url()->url() == turl2->url()->url()));
+ bool result = (turl1->url() == turl2->url()) &&
+ (turl1->keyword() == turl2->keyword()) &&
+ (turl1->short_name() == turl2->short_name());
- // Compare all major fields.
- bool result = (urls_match && turl1->keyword() == turl2->keyword() &&
- turl1->short_name() == turl2->short_name());
-
// Print some useful debug info.
if (!result) {
LOG(ERROR) << "TemplateURLs did not match: " << GetTURLInfoString(turl1)
@@ -148,7 +139,7 @@
<< default_b->keyword();
return false;
} else {
- LOG(INFO) << "A had default with URL: " << default_a->url()->url()
+ LOG(INFO) << "A had default with URL: " << default_a->url()
<< " and keyword: " << default_a->keyword();
}

Powered by Google App Engine
This is Rietveld 408576698