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

Side by Side Diff: chrome/browser/chromeos/attestation/attestation_policy_browsertest.cc

Issue 106373003: Restructured PlatformVerificationFlow testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/attestation/platform_verification_flow.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 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" 10 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 const std::string& signature, 68 const std::string& signature,
69 const std::string& platform_key_certificate) { 69 const std::string& platform_key_certificate) {
70 result_ = result; 70 result_ = result;
71 operation_complete_ = true; 71 operation_complete_ = true;
72 } 72 }
73 73
74 // Synchronously do what the content protection code path does when it wants 74 // Synchronously do what the content protection code path does when it wants
75 // to verify a Chrome OS platform. 75 // to verify a Chrome OS platform.
76 PlatformVerificationFlow::Result SyncContentProtectionAttestation() { 76 PlatformVerificationFlow::Result SyncContentProtectionAttestation() {
77 scoped_refptr<PlatformVerificationFlow> verifier( 77 scoped_refptr<PlatformVerificationFlow> verifier(
78 new PlatformVerificationFlow(NULL, NULL, &fake_cryptohome_client_, NULL, 78 new PlatformVerificationFlow(NULL, NULL, &fake_cryptohome_client_,
79 NULL)); 79 NULL));
80 verifier->ChallengePlatformKey( 80 verifier->ChallengePlatformKey(
81 browser()->tab_strip_model()->GetActiveWebContents(), 81 browser()->tab_strip_model()->GetActiveWebContents(),
82 "fake_service_id", 82 "fake_service_id",
83 "fake_challenge", 83 "fake_challenge",
84 base::Bind(&AttestationDevicePolicyTest::Callback, this)); 84 base::Bind(&AttestationDevicePolicyTest::Callback, this));
85 WaitForAsyncOperation(); 85 WaitForAsyncOperation();
86 return result_; 86 return result_;
87 } 87 }
88 88
(...skipping 26 matching lines...) Expand all
115 SyncContentProtectionAttestation()); 115 SyncContentProtectionAttestation());
116 116
117 GetDevicePolicyProto()->set_content_protection_enabled(true); 117 GetDevicePolicyProto()->set_content_protection_enabled(true);
118 SyncRefreshDevicePolicy(); 118 SyncRefreshDevicePolicy();
119 119
120 EXPECT_NE(PlatformVerificationFlow::POLICY_REJECTED, 120 EXPECT_NE(PlatformVerificationFlow::POLICY_REJECTED,
121 SyncContentProtectionAttestation()); 121 SyncContentProtectionAttestation());
122 } 122 }
123 123
124 } // namespace policy 124 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/attestation/platform_verification_flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698