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

Unified Diff: chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc

Issue 50093002: Added a timeout for platform verification key generation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc
diff --git a/chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc b/chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc
index 728b1e822cc98f60be6b3b7cf60be466b1851b15..d132a65d95d87cb039efd13f01530d83294f2631 100644
--- a/chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc
+++ b/chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc
@@ -130,11 +130,11 @@ class PlatformVerificationFlowTest : public ::testing::Test {
mock_user_manager_.SetActiveUser(kTestEmail);
// Create a verifier for tests to call.
- verifier_.reset(new PlatformVerificationFlow(&mock_attestation_flow_,
- &mock_async_caller_,
- &fake_cryptohome_client_,
- &mock_user_manager_,
- &fake_delegate_));
+ verifier_ = new PlatformVerificationFlow(&mock_attestation_flow_,
+ &mock_async_caller_,
+ &fake_cryptohome_client_,
+ &mock_user_manager_,
+ &fake_delegate_);
// Create callbacks for tests to use with verifier_.
callback_ = base::Bind(&PlatformVerificationFlowTest::FakeChallengeCallback,
@@ -162,7 +162,6 @@ class PlatformVerificationFlowTest : public ::testing::Test {
}
void TearDown() {
- verifier_.reset();
// Restore the real DeviceSettingsProvider.
CrosSettings* cros_settings = CrosSettings::Get();
cros_settings->RemoveSettingsProvider(&stub_settings_provider_);
@@ -241,7 +240,7 @@ class PlatformVerificationFlowTest : public ::testing::Test {
StubCrosSettingsProvider stub_settings_provider_;
ScopedTestDeviceSettingsService test_device_settings_service_;
ScopedTestCrosSettings test_cros_settings_;
- scoped_ptr<PlatformVerificationFlow> verifier_;
+ scoped_refptr<PlatformVerificationFlow> verifier_;
// Controls result of FakeGetCertificate.
bool certificate_success_;
@@ -378,5 +377,13 @@ TEST_F(PlatformVerificationFlowTest, ConsentNoResponse) {
EXPECT_EQ(PlatformVerificationFlow::USER_REJECTED, result_);
}
+TEST_F(PlatformVerificationFlowTest, Timeout) {
+ verifier_->set_timeout_delay(0);
+ ExpectAttestationFlow();
+ verifier_->ChallengePlatformKey(NULL, kTestID, kTestChallenge, callback_);
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(PlatformVerificationFlow::TIMEOUT, result_);
+}
+
} // namespace attestation
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698