| OLD | NEW |
| 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 #ifndef CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ | 5 #ifndef CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ |
| 6 #define CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ | 6 #define CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
| 11 #include "chrome/utility/importer/nss_decryptor.h" | 11 #include "chrome/utility/importer/nss_decryptor.h" |
| 12 #include "components/autofill/core/common/password_form.h" |
| 12 | 13 |
| 13 class FFDecryptorServerChannelListener; | 14 class FFDecryptorServerChannelListener; |
| 14 | 15 |
| 15 namespace base { | 16 namespace base { |
| 16 class MessageLoopForIO; | 17 class MessageLoopForIO; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace IPC { | 20 namespace IPC { |
| 20 class Channel; | 21 class Channel; |
| 21 } // namespace IPC | 22 } // namespace IPC |
| (...skipping 15 matching lines...) Expand all Loading... |
| 37 virtual ~FFUnitTestDecryptorProxy(); | 38 virtual ~FFUnitTestDecryptorProxy(); |
| 38 | 39 |
| 39 // Initialize a decryptor, returns true if the object was | 40 // Initialize a decryptor, returns true if the object was |
| 40 // constructed successfully. | 41 // constructed successfully. |
| 41 bool Setup(const base::FilePath& nss_path); | 42 bool Setup(const base::FilePath& nss_path); |
| 42 | 43 |
| 43 // This match the parallel functions in NSSDecryptor. | 44 // This match the parallel functions in NSSDecryptor. |
| 44 bool DecryptorInit(const base::FilePath& dll_path, | 45 bool DecryptorInit(const base::FilePath& dll_path, |
| 45 const base::FilePath& db_path); | 46 const base::FilePath& db_path); |
| 46 base::string16 Decrypt(const std::string& crypt); | 47 base::string16 Decrypt(const std::string& crypt); |
| 48 std::vector<autofill::PasswordForm> ParseSignons( |
| 49 const base::FilePath& signons_path); |
| 47 | 50 |
| 48 private: | 51 private: |
| 49 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
| 50 // Blocks until either a timeout is reached, or until the client process | 53 // Blocks until either a timeout is reached, or until the client process |
| 51 // responds to an IPC message. | 54 // responds to an IPC message. |
| 52 // Returns true if a reply was received successfully and false if the | 55 // Returns true if a reply was received successfully and false if the |
| 53 // the operation timed out. | 56 // the operation timed out. |
| 54 bool WaitForClientResponse(); | 57 bool WaitForClientResponse(); |
| 55 | 58 |
| 56 base::ProcessHandle child_process_; | 59 base::ProcessHandle child_process_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 77 } | 80 } |
| 78 | 81 |
| 79 bool FFUnitTestDecryptorProxy::DecryptorInit(const base::FilePath& dll_path, | 82 bool FFUnitTestDecryptorProxy::DecryptorInit(const base::FilePath& dll_path, |
| 80 const base::FilePath& db_path) { | 83 const base::FilePath& db_path) { |
| 81 return decryptor_.Init(dll_path, db_path); | 84 return decryptor_.Init(dll_path, db_path); |
| 82 } | 85 } |
| 83 | 86 |
| 84 base::string16 FFUnitTestDecryptorProxy::Decrypt(const std::string& crypt) { | 87 base::string16 FFUnitTestDecryptorProxy::Decrypt(const std::string& crypt) { |
| 85 return decryptor_.Decrypt(crypt); | 88 return decryptor_.Decrypt(crypt); |
| 86 } | 89 } |
| 90 |
| 91 std::vector<autofill::PasswordForm> FFUnitTestDecryptorProxy::ParseSignons( |
| 92 const base::FilePath& signons_path) { |
| 93 return decryptor_.ParseSignons(signons_path); |
| 94 } |
| 95 |
| 87 #endif // !OS_MACOSX | 96 #endif // !OS_MACOSX |
| 88 | 97 |
| 89 #endif // CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ | 98 #endif // CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_ |
| OLD | NEW |