| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/login/cryptohome_op.h" | 5 #include "chrome/browser/chromeos/login/cryptohome_op.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h" | 11 #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h" |
| 12 #include "chrome/browser/chromeos/cros/mock_library_loader.h" | 12 #include "chrome/browser/chromeos/cros/mock_library_loader.h" |
| 13 #include "chrome/browser/chromeos/login/auth_attempt_state.h" | 13 #include "chrome/browser/chromeos/login/auth_attempt_state.h" |
| 14 #include "chrome/browser/chromeos/login/mock_auth_attempt_state_resolver.h" | 14 #include "chrome/browser/chromeos/login/mock_auth_attempt_state_resolver.h" |
| 15 #include "chrome/browser/chromeos/login/test_attempt_state.h" | 15 #include "chrome/browser/chromeos/login/test_attempt_state.h" |
| 16 #include "content/test/test_browser_thread.h" | 16 #include "content/test/test_browser_thread.h" |
| 17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 using content::BrowserThread; |
| 21 |
| 20 using ::testing::AnyNumber; | 22 using ::testing::AnyNumber; |
| 21 using ::testing::Invoke; | 23 using ::testing::Invoke; |
| 22 using ::testing::Return; | 24 using ::testing::Return; |
| 23 using ::testing::_; | 25 using ::testing::_; |
| 24 | 26 |
| 25 namespace chromeos { | 27 namespace chromeos { |
| 26 | 28 |
| 27 class CryptohomeOpTest : public ::testing::Test { | 29 class CryptohomeOpTest : public ::testing::Test { |
| 28 public: | 30 public: |
| 29 CryptohomeOpTest() | 31 CryptohomeOpTest() |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 227 } |
| 226 | 228 |
| 227 TEST_F(CryptohomeOpTest, CheckKeyFailure) { | 229 TEST_F(CryptohomeOpTest, CheckKeyFailure) { |
| 228 ExpectCheckKey(); | 230 ExpectCheckKey(); |
| 229 scoped_refptr<CryptohomeOp> op( | 231 scoped_refptr<CryptohomeOp> op( |
| 230 CryptohomeOp::CreateCheckKeyAttempt(&state_, resolver_.get())); | 232 CryptohomeOp::CreateCheckKeyAttempt(&state_, resolver_.get())); |
| 231 RunTest(op.get(), false, kCryptohomeMountErrorKeyFailure); | 233 RunTest(op.get(), false, kCryptohomeMountErrorKeyFailure); |
| 232 } | 234 } |
| 233 | 235 |
| 234 } // namespace chromeos | 236 } // namespace chromeos |
| OLD | NEW |