| 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" | |
| 6 | |
| 7 #include "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 8 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/importer/firefox_importer_unittest_utils.h" | |
| 11 #include "chrome/browser/importer/nss_decryptor.h" | |
| 12 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
| 9 #include "chrome/utility/importer/firefox_importer_unittest_utils.h" |
| 10 #include "chrome/utility/importer/nss_decryptor.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 12 |
| 14 // TODO(jschuh): Disabled on Win64 build. http://crbug.com/179688 | 13 // TODO(jschuh): Disabled on Win64 build. http://crbug.com/179688 |
| 15 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) | 14 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) |
| 16 #define MAYBE_NSS(x) DISABLED_##x | 15 #define MAYBE_NSS(x) DISABLED_##x |
| 17 #else | 16 #else |
| 18 #define MAYBE_NSS(x) x | 17 #define MAYBE_NSS(x) x |
| 19 #endif | 18 #endif |
| 20 | 19 |
| 21 // The following test requires the use of the NSSDecryptor, on OSX this needs | 20 // The following test requires the use of the NSSDecryptor, on OSX this needs |
| 22 // to run in a separate process, so we use a proxy object so we can share the | 21 // to run in a separate process, so we use a proxy object so we can share the |
| (...skipping 15 matching lines...) Expand all Loading... |
| 38 | 37 |
| 39 ASSERT_TRUE(decryptor_proxy.DecryptorInit(nss_path, db_path)); | 38 ASSERT_TRUE(decryptor_proxy.DecryptorInit(nss_path, db_path)); |
| 40 EXPECT_EQ(ASCIIToUTF16("hello"), | 39 EXPECT_EQ(ASCIIToUTF16("hello"), |
| 41 decryptor_proxy.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECKa" | 40 decryptor_proxy.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECKa" |
| 42 "jtRg4qFSHBAhv9luFkXgDJA==")); | 41 "jtRg4qFSHBAhv9luFkXgDJA==")); |
| 43 // Test UTF-16 encoding. | 42 // Test UTF-16 encoding. |
| 44 EXPECT_EQ(WideToUTF16(L"\x4E2D"), | 43 EXPECT_EQ(WideToUTF16(L"\x4E2D"), |
| 45 decryptor_proxy.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECLW" | 44 decryptor_proxy.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECLW" |
| 46 "qqiccfQHWBAie74hxnULxlw==")); | 45 "qqiccfQHWBAie74hxnULxlw==")); |
| 47 } | 46 } |
| OLD | NEW |