| 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 "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/message_loop.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace chrome { | 14 namespace chrome { |
| 15 | 15 |
| 16 class InternalAuthTest : public ::testing::Test { | 16 class InternalAuthTest : public ::testing::Test { |
| 17 public: | 17 public: |
| 18 InternalAuthTest() { | 18 InternalAuthTest() { |
| 19 long_string_ = "seed"; | 19 long_string_ = "seed"; |
| 20 for (int i = 20; i--;) | 20 for (int i = 20; i--;) |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |