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

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

Issue 23742004: Move PasswordForm from //content to //autofill. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_password_form_conversion_utils
Patch Set: Rebase Created 7 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 // The order of these includes is important. 5 // The order of these includes is important.
6 #include <windows.h> 6 #include <windows.h>
7 #include <unknwn.h> 7 #include <unknwn.h>
8 #include <intshcut.h> 8 #include <intshcut.h>
9 #include <propvarutil.h> 9 #include <propvarutil.h>
10 #include <shlguid.h> 10 #include <shlguid.h>
(...skipping 25 matching lines...) Expand all
36 #include "chrome/common/chrome_paths.h" 36 #include "chrome/common/chrome_paths.h"
37 #include "chrome/common/importer/ie_importer_test_registry_overrider_win.h" 37 #include "chrome/common/importer/ie_importer_test_registry_overrider_win.h"
38 #include "chrome/common/importer/ie_importer_utils_win.h" 38 #include "chrome/common/importer/ie_importer_utils_win.h"
39 #include "chrome/common/importer/imported_bookmark_entry.h" 39 #include "chrome/common/importer/imported_bookmark_entry.h"
40 #include "chrome/common/importer/imported_favicon_usage.h" 40 #include "chrome/common/importer/imported_favicon_usage.h"
41 #include "chrome/common/importer/importer_bridge.h" 41 #include "chrome/common/importer/importer_bridge.h"
42 #include "chrome/common/importer/importer_data_types.h" 42 #include "chrome/common/importer/importer_data_types.h"
43 #include "chrome/common/importer/pstore_declarations.h" 43 #include "chrome/common/importer/pstore_declarations.h"
44 #include "chrome/test/base/in_process_browser_test.h" 44 #include "chrome/test/base/in_process_browser_test.h"
45 #include "chrome/test/base/testing_profile.h" 45 #include "chrome/test/base/testing_profile.h"
46 #include "components/autofill/core/common/password_form.h"
46 #include "components/webdata/encryptor/ie7_password.h" 47 #include "components/webdata/encryptor/ie7_password.h"
47 #include "content/public/common/password_form.h"
48 #include "testing/gtest/include/gtest/gtest.h" 48 #include "testing/gtest/include/gtest/gtest.h"
49 49
50 namespace { 50 namespace {
51 51
52 const BookmarkInfo kIEBookmarks[] = { 52 const BookmarkInfo kIEBookmarks[] = {
53 {true, 2, {L"Links", L"SubFolderOfLinks"}, 53 {true, 2, {L"Links", L"SubFolderOfLinks"},
54 L"SubLink", 54 L"SubLink",
55 "http://www.links-sublink.com/"}, 55 "http://www.links-sublink.com/"},
56 {true, 1, {L"Links"}, 56 {true, 1, {L"Links"},
57 L"TheLink", 57 L"TheLink",
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 295
296 virtual bool BookmarkModelIsLoaded() const { 296 virtual bool BookmarkModelIsLoaded() const {
297 // Profile is ready for writing. 297 // Profile is ready for writing.
298 return true; 298 return true;
299 } 299 }
300 300
301 virtual bool TemplateURLServiceIsLoaded() const { 301 virtual bool TemplateURLServiceIsLoaded() const {
302 return true; 302 return true;
303 } 303 }
304 304
305 virtual void AddPasswordForm(const content::PasswordForm& form) { 305 virtual void AddPasswordForm(const autofill::PasswordForm& form) {
306 // Importer should obtain this password form only. 306 // Importer should obtain this password form only.
307 EXPECT_EQ(GURL("http://localhost:8080/security/index.htm"), form.origin); 307 EXPECT_EQ(GURL("http://localhost:8080/security/index.htm"), form.origin);
308 EXPECT_EQ("http://localhost:8080/", form.signon_realm); 308 EXPECT_EQ("http://localhost:8080/", form.signon_realm);
309 EXPECT_EQ(L"user", form.username_element); 309 EXPECT_EQ(L"user", form.username_element);
310 EXPECT_EQ(L"1", form.username_value); 310 EXPECT_EQ(L"1", form.username_value);
311 EXPECT_EQ(L"", form.password_element); 311 EXPECT_EQ(L"", form.password_element);
312 EXPECT_EQ(L"2", form.password_value); 312 EXPECT_EQ(L"2", form.password_value);
313 EXPECT_EQ("", form.action.spec()); 313 EXPECT_EQ("", form.action.spec());
314 ++password_count_; 314 ++password_count_;
315 } 315 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {} 412 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {}
413 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {} 413 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {}
414 virtual void ImportEnded() OVERRIDE { 414 virtual void ImportEnded() OVERRIDE {
415 base::MessageLoop::current()->Quit(); 415 base::MessageLoop::current()->Quit();
416 EXPECT_EQ(arraysize(kIESortedBookmarks), bookmark_count_); 416 EXPECT_EQ(arraysize(kIESortedBookmarks), bookmark_count_);
417 } 417 }
418 418
419 virtual bool BookmarkModelIsLoaded() const { return true; } 419 virtual bool BookmarkModelIsLoaded() const { return true; }
420 virtual bool TemplateURLServiceIsLoaded() const { return true; } 420 virtual bool TemplateURLServiceIsLoaded() const { return true; }
421 421
422 virtual void AddPasswordForm(const content::PasswordForm& form) {} 422 virtual void AddPasswordForm(const autofill::PasswordForm& form) {}
423 virtual void AddHistoryPage(const history::URLRows& page, 423 virtual void AddHistoryPage(const history::URLRows& page,
424 history::VisitSource visit_source) {} 424 history::VisitSource visit_source) {}
425 virtual void AddKeyword(std::vector<TemplateURL*> template_url, 425 virtual void AddKeyword(std::vector<TemplateURL*> template_url,
426 int default_keyword_index) {} 426 int default_keyword_index) {}
427 virtual void AddBookmarks(const std::vector<ImportedBookmarkEntry>& bookmarks, 427 virtual void AddBookmarks(const std::vector<ImportedBookmarkEntry>& bookmarks,
428 const string16& top_level_folder_name) OVERRIDE { 428 const string16& top_level_folder_name) OVERRIDE {
429 ASSERT_LE(bookmark_count_ + bookmarks.size(), 429 ASSERT_LE(bookmark_count_ + bookmarks.size(),
430 arraysize(kIESortedBookmarks)); 430 arraysize(kIESortedBookmarks));
431 for (size_t i = 0; i < bookmarks.size(); ++i) { 431 for (size_t i = 0; i < bookmarks.size(); ++i) {
432 EXPECT_NO_FATAL_FAILURE( 432 EXPECT_NO_FATAL_FAILURE(
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 source_profile.source_path = temp_dir_.path(); 665 source_profile.source_path = temp_dir_.path();
666 666
667 host->StartImportSettings( 667 host->StartImportSettings(
668 source_profile, 668 source_profile,
669 browser()->profile(), 669 browser()->profile(),
670 importer::HOME_PAGE, 670 importer::HOME_PAGE,
671 observer); 671 observer);
672 base::MessageLoop::current()->Run(); 672 base::MessageLoop::current()->Run();
673 } 673 }
674 674
OLDNEW
« no previous file with comments | « chrome/browser/importer/firefox_importer_browsertest.cc ('k') | chrome/browser/importer/in_process_importer_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698