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

Side by Side Diff: chrome/browser/search_engines/template_url_service_util_unittest.cc

Issue 268643002: Use the DefaultSearchManager as the exclusive authority on DSE, ignoring Web Data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Last test fix? Created 6 years, 7 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 | Annotate | Revision Log
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_vector.h" 5 #include "base/memory/scoped_vector.h"
6 #include "base/strings/string_util.h" 6 #include "base/strings/string_util.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/search_engines/template_url.h" 8 #include "chrome/browser/search_engines/template_url.h"
9 #include "chrome/browser/search_engines/template_url_service.h" 9 #include "chrome/browser/search_engines/template_url_service.h"
10 #include "chrome/browser/search_engines/util.h" 10 #include "chrome/browser/search_engines/util.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 // ID set - Prefer the lowest TemplateURLID if the keywords don't match and if 80 // ID set - Prefer the lowest TemplateURLID if the keywords don't match and if
81 // none are the default. 81 // none are the default.
82 local_turls.push_back( 82 local_turls.push_back(
83 CreatePrepopulateTemplateURL(3, "winner6", 13).release()); 83 CreatePrepopulateTemplateURL(3, "winner6", 13).release());
84 local_turls.push_back( 84 local_turls.push_back(
85 CreatePrepopulateTemplateURL(3, "loser5", 14).release()); 85 CreatePrepopulateTemplateURL(3, "loser5", 14).release());
86 local_turls.push_back( 86 local_turls.push_back(
87 CreatePrepopulateTemplateURL(3, "loser6", 15).release()); 87 CreatePrepopulateTemplateURL(3, "loser6", 15).release());
88 88
89 RemoveDuplicatePrepopulateIDs(NULL, prepopulated_turls, default_turl, 89 RemoveDuplicatePrepopulateIDs(
90 &local_turls, NULL); 90 NULL, prepopulated_turls, default_turl, &local_turls, NULL);
91 91
92 // Verify that the expected local TURLs survived the process. 92 // Verify that the expected local TURLs survived the process.
93 EXPECT_EQ(local_turls.size(), 93 EXPECT_EQ(local_turls.size(),
94 prepopulated_turls.size() + num_non_prepopulated_urls); 94 prepopulated_turls.size() + num_non_prepopulated_urls);
95 for (TemplateURLService::TemplateURLVector::const_iterator itr = 95 for (TemplateURLService::TemplateURLVector::const_iterator itr =
96 local_turls.begin(); itr != local_turls.end(); ++itr) { 96 local_turls.begin(); itr != local_turls.end(); ++itr) {
97 EXPECT_TRUE( 97 EXPECT_TRUE(
98 StartsWith((*itr)->keyword(), base::ASCIIToUTF16("winner"), true)); 98 StartsWith((*itr)->keyword(), base::ASCIIToUTF16("winner"), true))
99 << "Expected '" << (*itr)->keyword() << "' to start with 'winner'.";
99 } 100 }
100 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698