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

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

Issue 27399004: Removed the implementation of CheckPlatformState. (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
« no previous file with comments | « chrome/browser/chromeos/attestation/platform_verification_flow.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 660f6f4ccc02096e258f3c069df98d4ccac64be4..a6aa46ec6ecb02019e5fe31c994421f5a3898b11 100644
--- a/chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc
+++ b/chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc
@@ -20,7 +20,6 @@
#include "chromeos/cryptohome/mock_async_method_caller.h"
#include "chromeos/dbus/fake_cryptohome_client.h"
#include "chromeos/settings/cros_settings_names.h"
-#include "chromeos/system/mock_statistics_provider.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -131,18 +130,11 @@ class PlatformVerificationFlowTest : public ::testing::Test {
// Configure a user for the mock user manager.
mock_user_manager_.SetActiveUser(kTestEmail);
- // Configure the statistics provider to report verified mode.
- EXPECT_CALL(mock_statistics_provider_,
- GetMachineStatistic(system::kDevSwitchBootMode, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<1>(std::string("0")),
- Return(true)));
-
// Create a verifier for tests to call.
verifier_.reset(new PlatformVerificationFlow(&mock_attestation_flow_,
&mock_async_caller_,
&fake_cryptohome_client_,
&mock_user_manager_,
- &mock_statistics_provider_,
&fake_delegate_));
// Create callbacks for tests to use with verifier_.
@@ -250,7 +242,6 @@ class PlatformVerificationFlowTest : public ::testing::Test {
cryptohome::MockAsyncMethodCaller mock_async_caller_;
CustomFakeCryptohomeClient fake_cryptohome_client_;
MockUserManager mock_user_manager_;
- system::MockStatisticsProvider mock_statistics_provider_;
FakeDelegate fake_delegate_;
TestingPrefServiceSimple pref_service_;
CrosSettingsProvider* device_settings_provider_;
@@ -402,54 +393,5 @@ TEST_F(PlatformVerificationFlowTest, FastCheck) {
EXPECT_TRUE(check_state_result_);
}
-TEST_F(PlatformVerificationFlowTest, FastCheckNoStat) {
- // Configure the stats provider to fail.
- EXPECT_CALL(mock_statistics_provider_,
- GetMachineStatistic(system::kDevSwitchBootMode, _))
- .WillRepeatedly(Return(false));
-
- verifier_->CheckPlatformState(check_state_callback_);
- base::RunLoop().RunUntilIdle();
- EXPECT_FALSE(check_state_result_);
-}
-
-TEST_F(PlatformVerificationFlowTest, FastCheckStatDevMode) {
- // Configure the stats provider to fail.
- EXPECT_CALL(mock_statistics_provider_,
- GetMachineStatistic(system::kDevSwitchBootMode, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<1>(std::string("1")),
- Return(true)));
-
- verifier_->CheckPlatformState(check_state_callback_);
- base::RunLoop().RunUntilIdle();
- EXPECT_FALSE(check_state_result_);
-}
-
-TEST_F(PlatformVerificationFlowTest, FastCheckStatInvalidMode) {
- // Configure the stats provider to fail.
- EXPECT_CALL(mock_statistics_provider_,
- GetMachineStatistic(system::kDevSwitchBootMode, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<1>(std::string("INVALID")),
- Return(true)));
-
- verifier_->CheckPlatformState(check_state_callback_);
- base::RunLoop().RunUntilIdle();
- EXPECT_FALSE(check_state_result_);
-}
-
-TEST_F(PlatformVerificationFlowTest, FastCheckNoAttestation) {
- fake_cryptohome_client_.set_attestation_prepared(false);
- verifier_->CheckPlatformState(check_state_callback_);
- base::RunLoop().RunUntilIdle();
- EXPECT_FALSE(check_state_result_);
-}
-
-TEST_F(PlatformVerificationFlowTest, FastCheckDBusFailure) {
- fake_cryptohome_client_.set_call_status(DBUS_METHOD_CALL_FAILURE);
- verifier_->CheckPlatformState(check_state_callback_);
- base::RunLoop().RunUntilIdle();
- EXPECT_FALSE(check_state_result_);
-}
-
} // namespace attestation
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/attestation/platform_verification_flow.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698