| OLD | NEW |
| 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_service.h" | |
| 9 #include "chrome/browser/search_engines/util.h" | |
| 10 #include "components/search_engines/search_terms_data.h" | 8 #include "components/search_engines/search_terms_data.h" |
| 11 #include "components/search_engines/template_url.h" | 9 #include "components/search_engines/template_url.h" |
| 10 #include "components/search_engines/template_url_service.h" |
| 11 #include "components/search_engines/util.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 scoped_ptr<TemplateURLData> CreatePrepopulateTemplateURLData( | 16 scoped_ptr<TemplateURLData> CreatePrepopulateTemplateURLData( |
| 17 int prepopulate_id, | 17 int prepopulate_id, |
| 18 const std::string& keyword, | 18 const std::string& keyword, |
| 19 TemplateURLID id) { | 19 TemplateURLID id) { |
| 20 scoped_ptr<TemplateURLData> data(new TemplateURLData); | 20 scoped_ptr<TemplateURLData> data(new TemplateURLData); |
| 21 data->prepopulate_id = prepopulate_id; | 21 data->prepopulate_id = prepopulate_id; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 // Verify that the expected local TURLs survived the process. | 93 // Verify that the expected local TURLs survived the process. |
| 94 EXPECT_EQ(local_turls.size(), | 94 EXPECT_EQ(local_turls.size(), |
| 95 prepopulated_turls.size() + num_non_prepopulated_urls); | 95 prepopulated_turls.size() + num_non_prepopulated_urls); |
| 96 for (TemplateURLService::TemplateURLVector::const_iterator itr = | 96 for (TemplateURLService::TemplateURLVector::const_iterator itr = |
| 97 local_turls.begin(); itr != local_turls.end(); ++itr) { | 97 local_turls.begin(); itr != local_turls.end(); ++itr) { |
| 98 EXPECT_TRUE( | 98 EXPECT_TRUE( |
| 99 StartsWith((*itr)->keyword(), base::ASCIIToUTF16("winner"), true)); | 99 StartsWith((*itr)->keyword(), base::ASCIIToUTF16("winner"), true)); |
| 100 } | 100 } |
| 101 } | 101 } |
| OLD | NEW |