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

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

Issue 8680040: Group forms-related files in webkit/glue in a forms/ subdirectory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + another build fix Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 // The order of these includes is important. 8 // The order of these includes is important.
9 #include <windows.h> 9 #include <windows.h>
10 #include <unknwn.h> 10 #include <unknwn.h>
(...skipping 18 matching lines...) Expand all
29 #include "chrome/browser/history/history_types.h" 29 #include "chrome/browser/history/history_types.h"
30 #include "chrome/browser/importer/importer_bridge.h" 30 #include "chrome/browser/importer/importer_bridge.h"
31 #include "chrome/browser/importer/importer_data_types.h" 31 #include "chrome/browser/importer/importer_data_types.h"
32 #include "chrome/browser/importer/importer_host.h" 32 #include "chrome/browser/importer/importer_host.h"
33 #include "chrome/browser/importer/importer_progress_observer.h" 33 #include "chrome/browser/importer/importer_progress_observer.h"
34 #include "chrome/browser/search_engines/template_url.h" 34 #include "chrome/browser/search_engines/template_url.h"
35 #include "chrome/common/chrome_paths.h" 35 #include "chrome/common/chrome_paths.h"
36 #include "chrome/test/base/testing_profile.h" 36 #include "chrome/test/base/testing_profile.h"
37 #include "content/test/test_browser_thread.h" 37 #include "content/test/test_browser_thread.h"
38 #include "testing/gtest/include/gtest/gtest.h" 38 #include "testing/gtest/include/gtest/gtest.h"
39 #include "webkit/glue/password_form.h" 39 #include "webkit/forms/password_form.h"
40 40
41 #if defined(OS_WIN) 41 #if defined(OS_WIN)
42 #include "base/win/scoped_comptr.h" 42 #include "base/win/scoped_comptr.h"
43 #include "base/win/windows_version.h" 43 #include "base/win/windows_version.h"
44 #include "chrome/browser/importer/ie_importer.h" 44 #include "chrome/browser/importer/ie_importer.h"
45 #include "chrome/browser/password_manager/ie7_password.h" 45 #include "chrome/browser/password_manager/ie7_password.h"
46 #endif 46 #endif
47 47
48 // TODO(estade): some of these are disabled on mac. http://crbug.com/48007 48 // TODO(estade): some of these are disabled on mac. http://crbug.com/48007
49 #if defined(OS_MACOSX) 49 #if defined(OS_MACOSX)
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 virtual bool BookmarkModelIsLoaded() const { 214 virtual bool BookmarkModelIsLoaded() const {
215 // Profile is ready for writing. 215 // Profile is ready for writing.
216 return true; 216 return true;
217 } 217 }
218 218
219 virtual bool TemplateURLServiceIsLoaded() const { 219 virtual bool TemplateURLServiceIsLoaded() const {
220 return true; 220 return true;
221 } 221 }
222 222
223 virtual void AddPasswordForm(const webkit_glue::PasswordForm& form) { 223 virtual void AddPasswordForm(const webkit::forms::PasswordForm& form) {
224 // Importer should obtain this password form only. 224 // Importer should obtain this password form only.
225 EXPECT_EQ(GURL("http://localhost:8080/security/index.htm"), form.origin); 225 EXPECT_EQ(GURL("http://localhost:8080/security/index.htm"), form.origin);
226 EXPECT_EQ("http://localhost:8080/", form.signon_realm); 226 EXPECT_EQ("http://localhost:8080/", form.signon_realm);
227 EXPECT_EQ(L"user", form.username_element); 227 EXPECT_EQ(L"user", form.username_element);
228 EXPECT_EQ(L"1", form.username_value); 228 EXPECT_EQ(L"1", form.username_value);
229 EXPECT_EQ(L"", form.password_element); 229 EXPECT_EQ(L"", form.password_element);
230 EXPECT_EQ(L"2", form.password_value); 230 EXPECT_EQ(L"2", form.password_value);
231 EXPECT_EQ("", form.action.spec()); 231 EXPECT_EQ("", form.action.spec());
232 ++password_count_; 232 ++password_count_;
233 } 233 }
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 549
550 virtual bool BookmarkModelIsLoaded() const { 550 virtual bool BookmarkModelIsLoaded() const {
551 // Profile is ready for writing. 551 // Profile is ready for writing.
552 return true; 552 return true;
553 } 553 }
554 554
555 virtual bool TemplateURLServiceIsLoaded() const { 555 virtual bool TemplateURLServiceIsLoaded() const {
556 return true; 556 return true;
557 } 557 }
558 558
559 virtual void AddPasswordForm(const webkit_glue::PasswordForm& form) { 559 virtual void AddPasswordForm(const webkit::forms::PasswordForm& form) {
560 PasswordList p = kFirefox2Passwords[password_count_]; 560 PasswordList p = kFirefox2Passwords[password_count_];
561 EXPECT_EQ(p.origin, form.origin.spec()); 561 EXPECT_EQ(p.origin, form.origin.spec());
562 EXPECT_EQ(p.realm, form.signon_realm); 562 EXPECT_EQ(p.realm, form.signon_realm);
563 EXPECT_EQ(p.action, form.action.spec()); 563 EXPECT_EQ(p.action, form.action.spec());
564 EXPECT_EQ(WideToUTF16(p.username_element), form.username_element); 564 EXPECT_EQ(WideToUTF16(p.username_element), form.username_element);
565 EXPECT_EQ(WideToUTF16(p.username), form.username_value); 565 EXPECT_EQ(WideToUTF16(p.username), form.username_value);
566 EXPECT_EQ(WideToUTF16(p.password_element), form.password_element); 566 EXPECT_EQ(WideToUTF16(p.password_element), form.password_element);
567 EXPECT_EQ(WideToUTF16(p.password), form.password_value); 567 EXPECT_EQ(WideToUTF16(p.password), form.password_value);
568 EXPECT_EQ(p.blacklisted, form.blacklisted_by_user); 568 EXPECT_EQ(p.blacklisted, form.blacklisted_by_user);
569 ++password_count_; 569 ++password_count_;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 753
754 virtual bool BookmarkModelIsLoaded() const { 754 virtual bool BookmarkModelIsLoaded() const {
755 // Profile is ready for writing. 755 // Profile is ready for writing.
756 return true; 756 return true;
757 } 757 }
758 758
759 virtual bool TemplateURLServiceIsLoaded() const { 759 virtual bool TemplateURLServiceIsLoaded() const {
760 return true; 760 return true;
761 } 761 }
762 762
763 virtual void AddPasswordForm(const webkit_glue::PasswordForm& form) { 763 virtual void AddPasswordForm(const webkit::forms::PasswordForm& form) {
764 PasswordList p = kFirefox3Passwords[password_count_]; 764 PasswordList p = kFirefox3Passwords[password_count_];
765 EXPECT_EQ(p.origin, form.origin.spec()); 765 EXPECT_EQ(p.origin, form.origin.spec());
766 EXPECT_EQ(p.realm, form.signon_realm); 766 EXPECT_EQ(p.realm, form.signon_realm);
767 EXPECT_EQ(p.action, form.action.spec()); 767 EXPECT_EQ(p.action, form.action.spec());
768 EXPECT_EQ(WideToUTF16(p.username_element), form.username_element); 768 EXPECT_EQ(WideToUTF16(p.username_element), form.username_element);
769 EXPECT_EQ(WideToUTF16(p.username), form.username_value); 769 EXPECT_EQ(WideToUTF16(p.username), form.username_value);
770 EXPECT_EQ(WideToUTF16(p.password_element), form.password_element); 770 EXPECT_EQ(WideToUTF16(p.password_element), form.password_element);
771 EXPECT_EQ(WideToUTF16(p.password), form.password_value); 771 EXPECT_EQ(WideToUTF16(p.password), form.password_value);
772 EXPECT_EQ(p.blacklisted, form.blacklisted_by_user); 772 EXPECT_EQ(p.blacklisted, form.blacklisted_by_user);
773 ++password_count_; 773 ++password_count_;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 true); 847 true);
848 } 848 }
849 849
850 TEST_F(ImporterTest, MAYBE(Firefox35Importer)) { 850 TEST_F(ImporterTest, MAYBE(Firefox35Importer)) {
851 bool import_search_engines = false; 851 bool import_search_engines = false;
852 scoped_refptr<Firefox3Observer> observer( 852 scoped_refptr<Firefox3Observer> observer(
853 new Firefox3Observer(import_search_engines)); 853 new Firefox3Observer(import_search_engines));
854 Firefox3xImporterTest("firefox35_profile", observer.get(), observer.get(), 854 Firefox3xImporterTest("firefox35_profile", observer.get(), observer.get(),
855 import_search_engines); 855 import_search_engines);
856 } 856 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/importer_bridge.h ('k') | chrome/browser/importer/in_process_importer_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698