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

Side by Side Diff: chrome/browser/internal_auth_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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
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 "chrome/browser/internal_auth.h" 5 #include "chrome/browser/internal_auth.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 10 matching lines...) Expand all
21 long_string_ += long_string_; 21 long_string_ += long_string_;
22 } 22 }
23 virtual ~InternalAuthTest() {} 23 virtual ~InternalAuthTest() {}
24 24
25 virtual void SetUp() { 25 virtual void SetUp() {
26 } 26 }
27 27
28 virtual void TearDown() { 28 virtual void TearDown() {
29 } 29 }
30 30
31 MessageLoop message_loop_; 31 base::MessageLoop message_loop_;
32 std::string long_string_; 32 std::string long_string_;
33 }; 33 };
34 34
35 TEST_F(InternalAuthTest, BasicGeneration) { 35 TEST_F(InternalAuthTest, BasicGeneration) {
36 std::map<std::string, std::string> map; 36 std::map<std::string, std::string> map;
37 map["key"] = "value"; 37 map["key"] = "value";
38 std::string token = InternalAuthGeneration::GeneratePassport( 38 std::string token = InternalAuthGeneration::GeneratePassport(
39 "zapata", map); 39 "zapata", map);
40 ASSERT_GT(token.size(), 10u); // short token is insecure. 40 ASSERT_GT(token.size(), 10u); // short token is insecure.
41 41
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 token = InternalAuthGeneration::GeneratePassport("zapata", map); 180 token = InternalAuthGeneration::GeneratePassport("zapata", map);
181 ASSERT_GT(token.size(), 10u); 181 ASSERT_GT(token.size(), 10u);
182 for (int i = 20; i--;) 182 for (int i = 20; i--;)
183 InternalAuthGeneration::GenerateNewKey(); 183 InternalAuthGeneration::GenerateNewKey();
184 // Passport should not survive series of key changes. 184 // Passport should not survive series of key changes.
185 ASSERT_FALSE(InternalAuthVerification::VerifyPassport(token, "zapata", map)); 185 ASSERT_FALSE(InternalAuthVerification::VerifyPassport(token, "zapata", map));
186 } 186 }
187 187
188 } // namespace chrome 188 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/importer/toolbar_importer_utils_browsertest.cc ('k') | chrome/browser/intranet_redirect_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698