 Chromium Code Reviews
 Chromium Code Reviews Issue 14348027:
  Move ie7_password namespace to //components, so it can be used by components.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 14348027:
  Move ie7_password namespace to //components, so it can be used by components.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| 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" | 5 #include "testing/gtest/include/gtest/gtest.h" | 
| 6 | 6 | 
| 7 // The order of these includes is important. | 7 // The order of these includes is important. | 
| 
Ilya Sherman
2013/04/20 01:37:25
Hmm, this comment makes me wonder if it's actually
 
Jói
2013/04/22 15:47:46
I'm pretty sure the only important bit is that <wi
 | |
| 8 #include <windows.h> | 8 #include <windows.h> | 
| 9 #include <unknwn.h> | 9 #include <unknwn.h> | 
| 10 #include <intshcut.h> | 10 #include <intshcut.h> | 
| 11 #include <propvarutil.h> | |
| 11 #include <shlguid.h> | 12 #include <shlguid.h> | 
| 13 #include <shlobj.h> | |
| 12 #include <urlhist.h> | 14 #include <urlhist.h> | 
| 13 #include <shlobj.h> | |
| 14 #include <propvarutil.h> | |
| 15 | 15 | 
| 16 #include <algorithm> | 16 #include <algorithm> | 
| 17 #include <vector> | 17 #include <vector> | 
| 18 | 18 | 
| 19 #include "base/bind.h" | 19 #include "base/bind.h" | 
| 20 #include "base/compiler_specific.h" | 20 #include "base/compiler_specific.h" | 
| 21 #include "base/file_util.h" | 21 #include "base/file_util.h" | 
| 22 #include "base/message_loop.h" | 22 #include "base/message_loop.h" | 
| 23 #include "base/path_service.h" | 23 #include "base/path_service.h" | 
| 24 #include "base/stl_util.h" | 24 #include "base/stl_util.h" | 
| 25 #include "base/string_util.h" | 25 #include "base/string_util.h" | 
| 26 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" | 
| 27 #include "base/win/registry.h" | 27 #include "base/win/registry.h" | 
| 28 #include "base/win/scoped_com_initializer.h" | 28 #include "base/win/scoped_com_initializer.h" | 
| 29 #include "base/win/scoped_comptr.h" | 29 #include "base/win/scoped_comptr.h" | 
| 30 #include "base/win/scoped_propvariant.h" | 30 #include "base/win/scoped_propvariant.h" | 
| 31 #include "base/win/windows_version.h" | 31 #include "base/win/windows_version.h" | 
| 32 #include "chrome/browser/history/history_types.h" | 32 #include "chrome/browser/history/history_types.h" | 
| 33 #include "chrome/browser/importer/ie_importer.h" | 33 #include "chrome/browser/importer/ie_importer.h" | 
| 34 #include "chrome/browser/importer/importer_bridge.h" | 34 #include "chrome/browser/importer/importer_bridge.h" | 
| 35 #include "chrome/browser/importer/importer_data_types.h" | 35 #include "chrome/browser/importer/importer_data_types.h" | 
| 36 #include "chrome/browser/importer/importer_host.h" | 36 #include "chrome/browser/importer/importer_host.h" | 
| 37 #include "chrome/browser/importer/importer_progress_observer.h" | 37 #include "chrome/browser/importer/importer_progress_observer.h" | 
| 38 #include "chrome/browser/importer/importer_unittest_utils.h" | 38 #include "chrome/browser/importer/importer_unittest_utils.h" | 
| 39 #include "chrome/browser/importer/pstore_declarations.h" | 39 #include "chrome/browser/importer/pstore_declarations.h" | 
| 40 #include "chrome/browser/password_manager/ie7_password.h" | |
| 41 #include "chrome/browser/search_engines/template_url.h" | 40 #include "chrome/browser/search_engines/template_url.h" | 
| 42 #include "chrome/common/chrome_paths.h" | 41 #include "chrome/common/chrome_paths.h" | 
| 43 #include "chrome/test/base/testing_profile.h" | 42 #include "chrome/test/base/testing_profile.h" | 
| 43 #include "components/webdata/encryptor/ie7_password.h" | |
| 44 #include "content/public/common/password_form.h" | 44 #include "content/public/common/password_form.h" | 
| 45 | 45 | 
| 46 namespace { | 46 namespace { | 
| 47 | 47 | 
| 48 const char16 kUnitTestRegistrySubKey[] = L"SOFTWARE\\Chromium Unit Tests"; | 48 const char16 kUnitTestRegistrySubKey[] = L"SOFTWARE\\Chromium Unit Tests"; | 
| 49 const char16 kUnitTestUserOverrideSubKey[] = | 49 const char16 kUnitTestUserOverrideSubKey[] = | 
| 50 L"SOFTWARE\\Chromium Unit Tests\\HKCU Override"; | 50 L"SOFTWARE\\Chromium Unit Tests\\HKCU Override"; | 
| 51 | 51 | 
| 52 const BookmarkInfo kIEBookmarks[] = { | 52 const BookmarkInfo kIEBookmarks[] = { | 
| 53 {true, 2, {L"Links", L"SubFolderOfLinks"}, | 53 {true, 2, {L"Links", L"SubFolderOfLinks"}, | 
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 645 ASSERT_TRUE(ie7_password::GetUserPassFromData(decrypted_data1, &username, | 645 ASSERT_TRUE(ie7_password::GetUserPassFromData(decrypted_data1, &username, | 
| 646 &password)); | 646 &password)); | 
| 647 EXPECT_EQ(L"abcdefgh", username); | 647 EXPECT_EQ(L"abcdefgh", username); | 
| 648 EXPECT_EQ(L"abcdefghijkl", password); | 648 EXPECT_EQ(L"abcdefghijkl", password); | 
| 649 | 649 | 
| 650 ASSERT_TRUE(ie7_password::GetUserPassFromData(decrypted_data2, &username, | 650 ASSERT_TRUE(ie7_password::GetUserPassFromData(decrypted_data2, &username, | 
| 651 &password)); | 651 &password)); | 
| 652 EXPECT_EQ(L"abcdefghi", username); | 652 EXPECT_EQ(L"abcdefghi", username); | 
| 653 EXPECT_EQ(L"abcdefg", password); | 653 EXPECT_EQ(L"abcdefg", password); | 
| 654 } | 654 } | 
| OLD | NEW |