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

Side by Side Diff: chrome/browser/importer/firefox_importer_browsertest.cc

Issue 2305813002: Remove ScopedVector from importer. (Closed)
Patch Set: rebase Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 const std::vector<autofill::AutofillEntry>& autofill_entries) override { 211 const std::vector<autofill::AutofillEntry>& autofill_entries) override {
212 EXPECT_EQ(arraysize(kFirefoxAutofillEntries), autofill_entries.size()); 212 EXPECT_EQ(arraysize(kFirefoxAutofillEntries), autofill_entries.size());
213 for (size_t i = 0; i < arraysize(kFirefoxAutofillEntries); ++i) { 213 for (size_t i = 0; i < arraysize(kFirefoxAutofillEntries); ++i) {
214 EXPECT_EQ(kFirefoxAutofillEntries[i].name, 214 EXPECT_EQ(kFirefoxAutofillEntries[i].name,
215 base::UTF16ToUTF8(autofill_entries[i].key().name())); 215 base::UTF16ToUTF8(autofill_entries[i].key().name()));
216 EXPECT_EQ(kFirefoxAutofillEntries[i].value, 216 EXPECT_EQ(kFirefoxAutofillEntries[i].value,
217 base::UTF16ToUTF8(autofill_entries[i].key().value())); 217 base::UTF16ToUTF8(autofill_entries[i].key().value()));
218 } 218 }
219 } 219 }
220 220
221 void AddKeywords(ScopedVector<TemplateURL> template_urls, 221 void AddKeywords(TemplateURLService::OwnedTemplateURLVector template_urls,
222 bool unique_on_host_and_path) override { 222 bool unique_on_host_and_path) override {
223 for (size_t i = 0; i < template_urls.size(); ++i) { 223 for (size_t i = 0; i < template_urls.size(); ++i) {
Peter Kasting 2016/09/01 22:55:41 Nit: While here: This loop (and the inner one, I t
Avi (use Gerrit) 2016/09/01 23:28:33 Done.
224 // The order might not be deterministic, look in the expected list for 224 // The order might not be deterministic, look in the expected list for
225 // that template URL. 225 // that template URL.
226 bool found = false; 226 bool found = false;
227 const base::string16& imported_keyword = template_urls[i]->keyword(); 227 const base::string16& imported_keyword = template_urls[i]->keyword();
228 for (size_t j = 0; j < arraysize(kFirefoxKeywords); ++j) { 228 for (size_t j = 0; j < arraysize(kFirefoxKeywords); ++j) {
229 const base::string16 expected_keyword = base::WideToUTF16( 229 const base::string16 expected_keyword = base::WideToUTF16(
230 use_keyword_in_json_ ? 230 use_keyword_in_json_ ?
231 kFirefoxKeywords[j].keyword_in_json : 231 kFirefoxKeywords[j].keyword_in_json :
232 kFirefoxKeywords[j].keyword_in_sqlite); 232 kFirefoxKeywords[j].keyword_in_sqlite);
233 if (imported_keyword == expected_keyword) { 233 if (imported_keyword == expected_keyword) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 scoped_refptr<FirefoxObserver> observer(new FirefoxObserver(true)); 355 scoped_refptr<FirefoxObserver> observer(new FirefoxObserver(true));
356 FirefoxImporterBrowserTest("firefox_profile", observer.get(), observer.get()); 356 FirefoxImporterBrowserTest("firefox_profile", observer.get(), observer.get());
357 } 357 }
358 358
359 IN_PROC_BROWSER_TEST_F(FirefoxProfileImporterBrowserTest, 359 IN_PROC_BROWSER_TEST_F(FirefoxProfileImporterBrowserTest,
360 MAYBE_IMPORTER(Firefox320Importer)) { 360 MAYBE_IMPORTER(Firefox320Importer)) {
361 scoped_refptr<FirefoxObserver> observer(new FirefoxObserver(true)); 361 scoped_refptr<FirefoxObserver> observer(new FirefoxObserver(true));
362 FirefoxImporterBrowserTest("firefox320_profile", observer.get(), 362 FirefoxImporterBrowserTest("firefox320_profile", observer.get(),
363 observer.get()); 363 observer.get());
364 } 364 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698