Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Side by Side Diff: components/webdata/encryptor/ie7_password_unittest_win.cc

Issue 18501013: Move most importer code to chrome/utility/importer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another gyp attempt Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/utility/profile_import_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "components/webdata/encryptor/ie7_password.h" 12 #include "components/webdata/encryptor/ie7_password.h"
13 13
14 TEST(IEImporterTest, IE7Importer) { 14 TEST(IE7PasswordTest, GetUserPassword) {
15 // This is the unencrypted values of my keys under Storage2. 15 // This is the unencrypted values of my keys under Storage2.
16 // The passwords have been manually changed to abcdef... but the size remains 16 // The passwords have been manually changed to abcdef... but the size remains
17 // the same. 17 // the same.
18 unsigned char data1[] = "\x0c\x00\x00\x00\x38\x00\x00\x00\x2c\x00\x00\x00" 18 unsigned char data1[] = "\x0c\x00\x00\x00\x38\x00\x00\x00\x2c\x00\x00\x00"
19 "\x57\x49\x43\x4b\x18\x00\x00\x00\x02\x00\x00\x00" 19 "\x57\x49\x43\x4b\x18\x00\x00\x00\x02\x00\x00\x00"
20 "\x67\x00\x72\x00\x01\x00\x00\x00\x00\x00\x00\x00" 20 "\x67\x00\x72\x00\x01\x00\x00\x00\x00\x00\x00\x00"
21 "\x00\x00\x00\x00\x4e\xfa\x67\x76\x22\x94\xc8\x01" 21 "\x00\x00\x00\x00\x4e\xfa\x67\x76\x22\x94\xc8\x01"
22 "\x08\x00\x00\x00\x12\x00\x00\x00\x4e\xfa\x67\x76" 22 "\x08\x00\x00\x00\x12\x00\x00\x00\x4e\xfa\x67\x76"
23 "\x22\x94\xc8\x01\x0c\x00\x00\x00\x61\x00\x62\x00" 23 "\x22\x94\xc8\x01\x0c\x00\x00\x00\x61\x00\x62\x00"
24 "\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00" 24 "\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00"
(...skipping 26 matching lines...) Expand all
51 ASSERT_TRUE(ie7_password::GetUserPassFromData(decrypted_data1, &username, 51 ASSERT_TRUE(ie7_password::GetUserPassFromData(decrypted_data1, &username,
52 &password)); 52 &password));
53 EXPECT_EQ(L"abcdefgh", username); 53 EXPECT_EQ(L"abcdefgh", username);
54 EXPECT_EQ(L"abcdefghijkl", password); 54 EXPECT_EQ(L"abcdefghijkl", password);
55 55
56 ASSERT_TRUE(ie7_password::GetUserPassFromData(decrypted_data2, &username, 56 ASSERT_TRUE(ie7_password::GetUserPassFromData(decrypted_data2, &username,
57 &password)); 57 &password));
58 EXPECT_EQ(L"abcdefghi", username); 58 EXPECT_EQ(L"abcdefghi", username);
59 EXPECT_EQ(L"abcdefg", password); 59 EXPECT_EQ(L"abcdefg", password);
60 } 60 }
OLDNEW
« no previous file with comments | « chrome/utility/profile_import_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698