| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/password_manager/core/browser/import/password_importer.h" | 5 #include "components/password_manager/core/browser/import/password_importer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/test/test_simple_task_runner.h" | 15 #include "base/test/test_simple_task_runner.h" |
| 16 #include "base/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
| 17 #include "components/autofill/core/common/password_form.h" | 17 #include "components/autofill/core/common/password_form.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 namespace password_manager { | 20 namespace password_manager { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 const char kTestOriginURL[] = "http://accounts.google.com/a/LoginAuth"; | 23 const char kTestOriginURL[] = "http://accounts.google.com/a/LoginAuth"; |
| 24 const char kTestSignonRealm[] = "http://accounts.google.com/"; | 24 const char kTestSignonRealm[] = "http://accounts.google.com/"; |
| 25 const char kTestUsername[] = "test@gmail.com"; | 25 const char kTestUsername[] = "test@gmail.com"; |
| 26 const char kTestPassword[] = "test1"; | 26 const char kTestPassword[] = "test1"; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 TEST_F(PasswordImporterTest, ImportIOErrorDueToUnreadableFile) { | 94 TEST_F(PasswordImporterTest, ImportIOErrorDueToUnreadableFile) { |
| 95 base::FilePath non_existent_input_file(FILE_PATH_LITERAL("nonexistent.csv")); | 95 base::FilePath non_existent_input_file(FILE_PATH_LITERAL("nonexistent.csv")); |
| 96 ASSERT_NO_FATAL_FAILURE( | 96 ASSERT_NO_FATAL_FAILURE( |
| 97 StartImportAndWaitForCompletion(non_existent_input_file)); | 97 StartImportAndWaitForCompletion(non_existent_input_file)); |
| 98 | 98 |
| 99 EXPECT_EQ(PasswordImporter::IO_ERROR, result()); | 99 EXPECT_EQ(PasswordImporter::IO_ERROR, result()); |
| 100 ASSERT_EQ(0u, imported_passwords().size()); | 100 ASSERT_EQ(0u, imported_passwords().size()); |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace password_manager | 103 } // namespace password_manager |
| OLD | NEW |