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/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" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // Creates a TemplateURL with default values except for the prepopulate ID, | 15 // Creates a TemplateURL with default values except for the prepopulate ID, |
16 // keyword and TemplateURLID. Only use this in tests if your tests do not | 16 // keyword and TemplateURLID. Only use this in tests if your tests do not |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 RemoveDuplicatePrepopulateIDs(NULL, prepopulated_turls, default_turl, | 69 RemoveDuplicatePrepopulateIDs(NULL, prepopulated_turls, default_turl, |
70 &local_turls, NULL); | 70 &local_turls, NULL); |
71 | 71 |
72 // Verify that the expected local TURLs survived the process. | 72 // Verify that the expected local TURLs survived the process. |
73 EXPECT_EQ(local_turls.size(), | 73 EXPECT_EQ(local_turls.size(), |
74 prepopulated_turls.size() + num_non_prepopulated_urls); | 74 prepopulated_turls.size() + num_non_prepopulated_urls); |
75 for (TemplateURLService::TemplateURLVector::const_iterator itr = | 75 for (TemplateURLService::TemplateURLVector::const_iterator itr = |
76 local_turls.begin(); itr != local_turls.end(); ++itr) | 76 local_turls.begin(); itr != local_turls.end(); ++itr) |
77 EXPECT_TRUE(StartsWith((*itr)->keyword(), ASCIIToUTF16("winner"), true)); | 77 EXPECT_TRUE(StartsWith((*itr)->keyword(), ASCIIToUTF16("winner"), true)); |
78 } | 78 } |
OLD | NEW |