| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 virtual void AddKeywords(ScopedVector<TemplateURL> template_urls, | 184 virtual void AddKeywords(ScopedVector<TemplateURL> template_urls, |
| 185 bool unique_on_host_and_path) { | 185 bool unique_on_host_and_path) { |
| 186 for (size_t i = 0; i < template_urls.size(); ++i) { | 186 for (size_t i = 0; i < template_urls.size(); ++i) { |
| 187 // The order might not be deterministic, look in the expected list for | 187 // The order might not be deterministic, look in the expected list for |
| 188 // that template URL. | 188 // that template URL. |
| 189 bool found = false; | 189 bool found = false; |
| 190 string16 keyword = template_urls[i]->keyword(); | 190 string16 keyword = template_urls[i]->keyword(); |
| 191 for (size_t j = 0; j < arraysize(kFirefox2Keywords); ++j) { | 191 for (size_t j = 0; j < arraysize(kFirefox2Keywords); ++j) { |
| 192 if (template_urls[i]->keyword() == | 192 if (template_urls[i]->keyword() == |
| 193 WideToUTF16Hack(kFirefox2Keywords[j].keyword)) { | 193 WideToUTF16Hack(kFirefox2Keywords[j].keyword)) { |
| 194 EXPECT_EQ(kFirefox2Keywords[j].url, template_urls[i]->url()->url()); | 194 EXPECT_EQ(kFirefox2Keywords[j].url, template_urls[i]->url()); |
| 195 found = true; | 195 found = true; |
| 196 break; | 196 break; |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 EXPECT_TRUE(found); | 199 EXPECT_TRUE(found); |
| 200 ++keyword_count_; | 200 ++keyword_count_; |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 void AddFavicons(const std::vector<history::ImportedFaviconUsage>& favicons) { | 204 void AddFavicons(const std::vector<history::ImportedFaviconUsage>& favicons) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 void AddKeywords(ScopedVector<TemplateURL> template_urls, | 334 void AddKeywords(ScopedVector<TemplateURL> template_urls, |
| 335 bool unique_on_host_and_path) { | 335 bool unique_on_host_and_path) { |
| 336 for (size_t i = 0; i < template_urls.size(); ++i) { | 336 for (size_t i = 0; i < template_urls.size(); ++i) { |
| 337 // The order might not be deterministic, look in the expected list for | 337 // The order might not be deterministic, look in the expected list for |
| 338 // that template URL. | 338 // that template URL. |
| 339 bool found = false; | 339 bool found = false; |
| 340 string16 keyword = template_urls[i]->keyword(); | 340 string16 keyword = template_urls[i]->keyword(); |
| 341 for (size_t j = 0; j < arraysize(kFirefox3Keywords); ++j) { | 341 for (size_t j = 0; j < arraysize(kFirefox3Keywords); ++j) { |
| 342 if (template_urls[i]->keyword() == | 342 if (template_urls[i]->keyword() == |
| 343 WideToUTF16Hack(kFirefox3Keywords[j].keyword)) { | 343 WideToUTF16Hack(kFirefox3Keywords[j].keyword)) { |
| 344 EXPECT_EQ(kFirefox3Keywords[j].url, template_urls[i]->url()->url()); | 344 EXPECT_EQ(kFirefox3Keywords[j].url, template_urls[i]->url()); |
| 345 found = true; | 345 found = true; |
| 346 break; | 346 break; |
| 347 } | 347 } |
| 348 } | 348 } |
| 349 EXPECT_TRUE(found); | 349 EXPECT_TRUE(found); |
| 350 ++keyword_count_; | 350 ++keyword_count_; |
| 351 } | 351 } |
| 352 } | 352 } |
| 353 | 353 |
| 354 void AddFavicons(const std::vector<history::ImportedFaviconUsage>& favicons) { | 354 void AddFavicons(const std::vector<history::ImportedFaviconUsage>& favicons) { |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 EXPECT_EQ("http://www.tamurayukari.com/", entry.url.spec()); | 755 EXPECT_EQ("http://www.tamurayukari.com/", entry.url.spec()); |
| 756 EXPECT_EQ(0U, entry.path.size()); | 756 EXPECT_EQ(0U, entry.path.size()); |
| 757 entry = *it++; | 757 entry = *it++; |
| 758 EXPECT_EQ(ASCIIToUTF16("Google"), entry.title); | 758 EXPECT_EQ(ASCIIToUTF16("Google"), entry.title); |
| 759 EXPECT_EQ("http://www.google.com/", entry.url.spec()); | 759 EXPECT_EQ("http://www.google.com/", entry.url.spec()); |
| 760 EXPECT_EQ(0U, entry.path.size()); | 760 EXPECT_EQ(0U, entry.path.size()); |
| 761 } | 761 } |
| 762 | 762 |
| 763 importer->Release(); | 763 importer->Release(); |
| 764 } | 764 } |
| OLD | NEW |