| 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" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/history/history_types.h" | 15 #include "chrome/browser/history/history_types.h" |
| 16 #include "chrome/browser/importer/firefox2_importer.h" | 16 #include "chrome/browser/importer/firefox2_importer.h" |
| 17 #include "chrome/browser/importer/firefox_importer_unittest_utils.h" | 17 #include "chrome/browser/importer/firefox_importer_unittest_utils.h" |
| 18 #include "chrome/browser/importer/firefox_importer_utils.h" | 18 #include "chrome/browser/importer/firefox_importer_utils.h" |
| 19 #include "chrome/browser/importer/importer_bridge.h" | 19 #include "chrome/browser/importer/importer_bridge.h" |
| 20 #include "chrome/browser/importer/importer_data_types.h" | 20 #include "chrome/browser/importer/importer_data_types.h" |
| 21 #include "chrome/browser/importer/importer_host.h" | 21 #include "chrome/browser/importer/importer_host.h" |
| 22 #include "chrome/browser/importer/importer_progress_observer.h" | 22 #include "chrome/browser/importer/importer_progress_observer.h" |
| 23 #include "chrome/browser/importer/importer_unittest_utils.h" | 23 #include "chrome/browser/importer/importer_unittest_utils.h" |
| 24 #include "chrome/browser/importer/nss_decryptor.h" | 24 #include "chrome/browser/importer/nss_decryptor.h" |
| 25 #include "chrome/browser/search_engines/template_url.h" | 25 #include "chrome/browser/search_engines/template_url.h" |
| 26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| 27 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
| 28 #include "webkit/forms/password_form.h" | 28 #include "content/public/common/password_form.h" |
| 29 | 29 |
| 30 // TODO(estade): some of these are disabled on mac. http://crbug.com/48007 | 30 // TODO(estade): some of these are disabled on mac. http://crbug.com/48007 |
| 31 #if defined(OS_MACOSX) | 31 #if defined(OS_MACOSX) |
| 32 #define MAYBE(x) DISABLED_##x | 32 #define MAYBE(x) DISABLED_##x |
| 33 #else | 33 #else |
| 34 #define MAYBE(x) x | 34 #define MAYBE(x) x |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 virtual bool BookmarkModelIsLoaded() const { | 144 virtual bool BookmarkModelIsLoaded() const { |
| 145 // Profile is ready for writing. | 145 // Profile is ready for writing. |
| 146 return true; | 146 return true; |
| 147 } | 147 } |
| 148 | 148 |
| 149 virtual bool TemplateURLServiceIsLoaded() const { | 149 virtual bool TemplateURLServiceIsLoaded() const { |
| 150 return true; | 150 return true; |
| 151 } | 151 } |
| 152 | 152 |
| 153 virtual void AddPasswordForm(const webkit::forms::PasswordForm& form) { | 153 virtual void AddPasswordForm(const content::PasswordForm& form) { |
| 154 PasswordInfo p = kFirefox2Passwords[password_count_]; | 154 PasswordInfo p = kFirefox2Passwords[password_count_]; |
| 155 EXPECT_EQ(p.origin, form.origin.spec()); | 155 EXPECT_EQ(p.origin, form.origin.spec()); |
| 156 EXPECT_EQ(p.realm, form.signon_realm); | 156 EXPECT_EQ(p.realm, form.signon_realm); |
| 157 EXPECT_EQ(p.action, form.action.spec()); | 157 EXPECT_EQ(p.action, form.action.spec()); |
| 158 EXPECT_EQ(WideToUTF16(p.username_element), form.username_element); | 158 EXPECT_EQ(WideToUTF16(p.username_element), form.username_element); |
| 159 EXPECT_EQ(WideToUTF16(p.username), form.username_value); | 159 EXPECT_EQ(WideToUTF16(p.username), form.username_value); |
| 160 EXPECT_EQ(WideToUTF16(p.password_element), form.password_element); | 160 EXPECT_EQ(WideToUTF16(p.password_element), form.password_element); |
| 161 EXPECT_EQ(WideToUTF16(p.password), form.password_value); | 161 EXPECT_EQ(WideToUTF16(p.password), form.password_value); |
| 162 EXPECT_EQ(p.blacklisted, form.blacklisted_by_user); | 162 EXPECT_EQ(p.blacklisted, form.blacklisted_by_user); |
| 163 ++password_count_; | 163 ++password_count_; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 virtual bool BookmarkModelIsLoaded() const { | 289 virtual bool BookmarkModelIsLoaded() const { |
| 290 // Profile is ready for writing. | 290 // Profile is ready for writing. |
| 291 return true; | 291 return true; |
| 292 } | 292 } |
| 293 | 293 |
| 294 virtual bool TemplateURLServiceIsLoaded() const { | 294 virtual bool TemplateURLServiceIsLoaded() const { |
| 295 return true; | 295 return true; |
| 296 } | 296 } |
| 297 | 297 |
| 298 virtual void AddPasswordForm(const webkit::forms::PasswordForm& form) { | 298 virtual void AddPasswordForm(const content::PasswordForm& form) { |
| 299 PasswordInfo p = kFirefox3Passwords[password_count_]; | 299 PasswordInfo p = kFirefox3Passwords[password_count_]; |
| 300 EXPECT_EQ(p.origin, form.origin.spec()); | 300 EXPECT_EQ(p.origin, form.origin.spec()); |
| 301 EXPECT_EQ(p.realm, form.signon_realm); | 301 EXPECT_EQ(p.realm, form.signon_realm); |
| 302 EXPECT_EQ(p.action, form.action.spec()); | 302 EXPECT_EQ(p.action, form.action.spec()); |
| 303 EXPECT_EQ(WideToUTF16(p.username_element), form.username_element); | 303 EXPECT_EQ(WideToUTF16(p.username_element), form.username_element); |
| 304 EXPECT_EQ(WideToUTF16(p.username), form.username_value); | 304 EXPECT_EQ(WideToUTF16(p.username), form.username_value); |
| 305 EXPECT_EQ(WideToUTF16(p.password_element), form.password_element); | 305 EXPECT_EQ(WideToUTF16(p.password_element), form.password_element); |
| 306 EXPECT_EQ(WideToUTF16(p.password), form.password_value); | 306 EXPECT_EQ(WideToUTF16(p.password), form.password_value); |
| 307 EXPECT_EQ(p.blacklisted, form.blacklisted_by_user); | 307 EXPECT_EQ(p.blacklisted, form.blacklisted_by_user); |
| 308 ++password_count_; | 308 ++password_count_; |
| (...skipping 446 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 |