| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "chrome/browser/importer/firefox2_importer.h" | 9 #include "chrome/browser/importer/firefox2_importer.h" |
| 10 #include "chrome/browser/importer/firefox_importer_utils.h" | 10 #include "chrome/browser/importer/firefox_importer_utils.h" |
| 11 #include "chrome/browser/importer/firefox_profile_lock.h" | 11 #include "chrome/browser/importer/firefox_profile_lock.h" |
| 12 #include "chrome/common/chrome_paths.h" | 12 #include "chrome/common/chrome_paths.h" |
| 13 | 13 |
| 14 using base::Time; |
| 15 |
| 14 TEST(FirefoxImporterTest, Firefox2NSS3Decryptor) { | 16 TEST(FirefoxImporterTest, Firefox2NSS3Decryptor) { |
| 15 std::wstring nss_path; | 17 std::wstring nss_path; |
| 16 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &nss_path)); | 18 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &nss_path)); |
| 17 file_util::AppendToPath(&nss_path, L"firefox2_nss"); | 19 file_util::AppendToPath(&nss_path, L"firefox2_nss"); |
| 18 std::wstring db_path; | 20 std::wstring db_path; |
| 19 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &db_path)); | 21 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &db_path)); |
| 20 file_util::AppendToPath(&db_path, L"firefox2_profile"); | 22 file_util::AppendToPath(&db_path, L"firefox2_profile"); |
| 21 NSSDecryptor decryptor; | 23 NSSDecryptor decryptor; |
| 22 EXPECT_TRUE(decryptor.Init(nss_path, db_path)); | 24 EXPECT_TRUE(decryptor.Init(nss_path, db_path)); |
| 23 EXPECT_EQ(L"hello", decryptor.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAE" | 25 EXPECT_EQ(L"hello", decryptor.Decrypt("MDIEEPgAAAAAAAAAAAAAAAAAAAE" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 209 |
| 208 lock1->Unlock(); | 210 lock1->Unlock(); |
| 209 EXPECT_FALSE(lock1->HasAcquired()); | 211 EXPECT_FALSE(lock1->HasAcquired()); |
| 210 | 212 |
| 211 lock2->Lock(); | 213 lock2->Lock(); |
| 212 EXPECT_TRUE(lock2->HasAcquired()); | 214 EXPECT_TRUE(lock2->HasAcquired()); |
| 213 lock2->Unlock(); | 215 lock2->Unlock(); |
| 214 EXPECT_FALSE(lock2->HasAcquired()); | 216 EXPECT_FALSE(lock2->HasAcquired()); |
| 215 } | 217 } |
| 216 | 218 |
| OLD | NEW |