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

Side by Side Diff: components/os_crypt/ie7_password_win_unittest.cc

Issue 1551433002: Switch to standard integer types in components/, part 3 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 4 years, 12 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
« no previous file with comments | « components/os_crypt/ie7_password_win.cc ('k') | components/os_crypt/os_crypt.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/os_crypt/ie7_password_win.h" 5 #include "components/os_crypt/ie7_password_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 TEST(IE7PasswordTest, GetUserPassword) { 14 TEST(IE7PasswordTest, GetUserPassword) {
14 // This is the unencrypted values of my keys under Storage2. 15 // This is the unencrypted values of my keys under Storage2.
15 // 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
16 // the same. 17 // the same.
17 const unsigned char kData1[] = 18 const unsigned char kData1[] =
18 "\x0c\x00\x00\x00\x38\x00\x00\x00\x2c\x00\x00\x00" 19 "\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" 20 "\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" 21 "\x67\x00\x72\x00\x01\x00\x00\x00\x00\x00\x00\x00"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 std::vector<ie7_password::DecryptedCredentials> credentials; 82 std::vector<ie7_password::DecryptedCredentials> credentials;
82 ASSERT_TRUE(ie7_password::GetUserPassFromData(decrypted_data, &credentials)); 83 ASSERT_TRUE(ie7_password::GetUserPassFromData(decrypted_data, &credentials));
83 ASSERT_EQ(3u, credentials.size()); 84 ASSERT_EQ(3u, credentials.size());
84 EXPECT_EQ(L"qwer", credentials[0].username); 85 EXPECT_EQ(L"qwer", credentials[0].username);
85 EXPECT_EQ(L"qwerty", credentials[0].password); 86 EXPECT_EQ(L"qwerty", credentials[0].password);
86 EXPECT_EQ(L"asdf", credentials[1].username); 87 EXPECT_EQ(L"asdf", credentials[1].username);
87 EXPECT_EQ(L"asdfgh", credentials[1].password); 88 EXPECT_EQ(L"asdfgh", credentials[1].password);
88 EXPECT_EQ(L"zxcv", credentials[2].username); 89 EXPECT_EQ(L"zxcv", credentials[2].username);
89 EXPECT_EQ(L"zxcvbn", credentials[2].password); 90 EXPECT_EQ(L"zxcvbn", credentials[2].password);
90 } 91 }
OLDNEW
« no previous file with comments | « components/os_crypt/ie7_password_win.cc ('k') | components/os_crypt/os_crypt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698