OLD | NEW |
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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "chrome/browser/importer/external_process_importer_host.h" | 14 #include "chrome/browser/importer/external_process_importer_host.h" |
15 #include "chrome/browser/importer/importer_progress_observer.h" | 15 #include "chrome/browser/importer/importer_progress_observer.h" |
16 #include "chrome/browser/importer/importer_unittest_utils.h" | 16 #include "chrome/browser/importer/importer_unittest_utils.h" |
17 #include "chrome/browser/search_engines/template_url.h" | 17 #include "chrome/browser/search_engines/template_url.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
20 #include "chrome/common/importer/imported_bookmark_entry.h" | 20 #include "chrome/common/importer/imported_bookmark_entry.h" |
21 #include "chrome/common/importer/imported_favicon_usage.h" | 21 #include "chrome/common/importer/imported_favicon_usage.h" |
22 #include "chrome/common/importer/importer_data_types.h" | 22 #include "chrome/common/importer/importer_data_types.h" |
23 #include "chrome/test/base/in_process_browser_test.h" | 23 #include "chrome/test/base/in_process_browser_test.h" |
24 #include "content/public/common/password_form.h" | 24 #include "components/autofill/core/common/password_form.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
26 | 26 |
27 // TODO(estade): some of these are disabled on mac. http://crbug.com/48007 | 27 // TODO(estade): some of these are disabled on mac. http://crbug.com/48007 |
28 // TODO(jschuh): Disabled on Win64 build. http://crbug.com/179688 | 28 // TODO(jschuh): Disabled on Win64 build. http://crbug.com/179688 |
29 #if defined(OS_MACOSX) || (defined(OS_WIN) && defined(ARCH_CPU_X86_64)) | 29 #if defined(OS_MACOSX) || (defined(OS_WIN) && defined(ARCH_CPU_X86_64)) |
30 #define MAYBE_IMPORTER(x) DISABLED_##x | 30 #define MAYBE_IMPORTER(x) DISABLED_##x |
31 #else | 31 #else |
32 #define MAYBE_IMPORTER(x) x | 32 #define MAYBE_IMPORTER(x) x |
33 #endif | 33 #endif |
34 | 34 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 virtual bool BookmarkModelIsLoaded() const OVERRIDE { | 126 virtual bool BookmarkModelIsLoaded() const OVERRIDE { |
127 // Profile is ready for writing. | 127 // Profile is ready for writing. |
128 return true; | 128 return true; |
129 } | 129 } |
130 | 130 |
131 virtual bool TemplateURLServiceIsLoaded() const OVERRIDE { | 131 virtual bool TemplateURLServiceIsLoaded() const OVERRIDE { |
132 return true; | 132 return true; |
133 } | 133 } |
134 | 134 |
135 virtual void AddPasswordForm(const content::PasswordForm& form) OVERRIDE { | 135 virtual void AddPasswordForm(const autofill::PasswordForm& form) OVERRIDE { |
136 PasswordInfo p = kFirefoxPasswords[password_count_]; | 136 PasswordInfo p = kFirefoxPasswords[password_count_]; |
137 EXPECT_EQ(p.origin, form.origin.spec()); | 137 EXPECT_EQ(p.origin, form.origin.spec()); |
138 EXPECT_EQ(p.realm, form.signon_realm); | 138 EXPECT_EQ(p.realm, form.signon_realm); |
139 EXPECT_EQ(p.action, form.action.spec()); | 139 EXPECT_EQ(p.action, form.action.spec()); |
140 EXPECT_EQ(WideToUTF16(p.username_element), form.username_element); | 140 EXPECT_EQ(WideToUTF16(p.username_element), form.username_element); |
141 EXPECT_EQ(WideToUTF16(p.username), form.username_value); | 141 EXPECT_EQ(WideToUTF16(p.username), form.username_value); |
142 EXPECT_EQ(WideToUTF16(p.password_element), form.password_element); | 142 EXPECT_EQ(WideToUTF16(p.password_element), form.password_element); |
143 EXPECT_EQ(WideToUTF16(p.password), form.password_value); | 143 EXPECT_EQ(WideToUTF16(p.password), form.password_value); |
144 EXPECT_EQ(p.blacklisted, form.blacklisted_by_user); | 144 EXPECT_EQ(p.blacklisted, form.blacklisted_by_user); |
145 ++password_count_; | 145 ++password_count_; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 287 } |
288 | 288 |
289 IN_PROC_BROWSER_TEST_F(FirefoxProfileImporterBrowserTest, | 289 IN_PROC_BROWSER_TEST_F(FirefoxProfileImporterBrowserTest, |
290 MAYBE_IMPORTER(Firefox35Importer)) { | 290 MAYBE_IMPORTER(Firefox35Importer)) { |
291 bool import_search_engines = false; | 291 bool import_search_engines = false; |
292 scoped_refptr<FirefoxObserver> observer( | 292 scoped_refptr<FirefoxObserver> observer( |
293 new FirefoxObserver(import_search_engines)); | 293 new FirefoxObserver(import_search_engines)); |
294 Firefox3xImporterBrowserTest("firefox35_profile", observer.get(), | 294 Firefox3xImporterBrowserTest("firefox35_profile", observer.get(), |
295 observer.get(), import_search_engines); | 295 observer.get(), import_search_engines); |
296 } | 296 } |
OLD | NEW |