OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const char kTestEmail[] = "test_email@chromium.org"; | 43 const char kTestEmail[] = "test_email@chromium.org"; |
44 const char kTestURL[] = "http://mytestdomain/test"; | 44 const char kTestURL[] = "http://mytestdomain/test"; |
45 | 45 |
46 class FakeDelegate : public PlatformVerificationFlow::Delegate { | 46 class FakeDelegate : public PlatformVerificationFlow::Delegate { |
47 public: | 47 public: |
48 FakeDelegate() | 48 FakeDelegate() |
49 : url_(kTestURL), | 49 : url_(kTestURL), |
50 is_permitted_by_user_(true), | 50 is_permitted_by_user_(true), |
51 is_in_supported_mode_(true) { | 51 is_in_supported_mode_(true) { |
52 // Configure a user for the mock user manager. | 52 // Configure a user for the mock user manager. |
53 mock_user_manager_.SetActiveUser(kTestEmail); | 53 mock_user_manager_.SetActiveUser(AccountId::FromUserEmail(kTestEmail)); |
54 } | 54 } |
55 ~FakeDelegate() override {} | 55 ~FakeDelegate() override {} |
56 | 56 |
57 const GURL& GetURL(content::WebContents* web_contents) override { | 57 const GURL& GetURL(content::WebContents* web_contents) override { |
58 return url_; | 58 return url_; |
59 } | 59 } |
60 | 60 |
61 user_manager::User* GetUser(content::WebContents* web_contents) override { | 61 user_manager::User* GetUser(content::WebContents* web_contents) override { |
62 return mock_user_manager_.GetActiveUser(); | 62 return mock_user_manager_.GetActiveUser(); |
63 } | 63 } |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 TEST_F(PlatformVerificationFlowTest, AttestationNotPrepared) { | 399 TEST_F(PlatformVerificationFlowTest, AttestationNotPrepared) { |
400 fake_cryptohome_client_.set_attestation_enrolled(false); | 400 fake_cryptohome_client_.set_attestation_enrolled(false); |
401 fake_cryptohome_client_.set_attestation_prepared(false); | 401 fake_cryptohome_client_.set_attestation_prepared(false); |
402 verifier_->ChallengePlatformKey(NULL, kTestID, kTestChallenge, callback_); | 402 verifier_->ChallengePlatformKey(NULL, kTestID, kTestChallenge, callback_); |
403 base::RunLoop().RunUntilIdle(); | 403 base::RunLoop().RunUntilIdle(); |
404 EXPECT_EQ(PlatformVerificationFlow::PLATFORM_NOT_VERIFIED, result_); | 404 EXPECT_EQ(PlatformVerificationFlow::PLATFORM_NOT_VERIFIED, result_); |
405 } | 405 } |
406 | 406 |
407 } // namespace attestation | 407 } // namespace attestation |
408 } // namespace chromeos | 408 } // namespace chromeos |
OLD | NEW |