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

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

Issue 2033753002: Remove use of deprecated MessageLoop methods in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: manual change Created 4 years, 7 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 58897b35b00a1bfadde31e49aa3c056023febffb..1b5476a4a91bd5fd24c3aec57384be91abdc431b 100644
--- a/chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc
+++ b/chrome/browser/chromeos/attestation/platform_verification_flow_unittest.cc
@@ -8,9 +8,12 @@
#include <string>
#include "base/bind.h"
+#include "base/location.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/single_thread_task_runner.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/chromeos/attestation/attestation_signed_data.pb.h"
#include "chrome/browser/chromeos/attestation/fake_certificate.h"
#include "chrome/browser/chromeos/attestation/platform_verification_flow.h"
@@ -101,18 +104,14 @@ class CustomFakeCryptohomeClient : public FakeCryptohomeClient {
attestation_prepared_(true) {}
void TpmAttestationIsEnrolled(
const BoolDBusMethodCallback& callback) override {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback,
- call_status_,
- attestation_enrolled_));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, call_status_, attestation_enrolled_));
}
void TpmAttestationIsPrepared(
const BoolDBusMethodCallback& callback) override {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback,
- call_status_,
- attestation_prepared_));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, call_status_, attestation_prepared_));
}
void set_call_status(DBusMethodCallStatus call_status) {
@@ -188,20 +187,16 @@ class PlatformVerificationFlowTest : public ::testing::Test {
std::string certificate =
(fake_certificate_index_ < fake_certificate_list_.size()) ?
fake_certificate_list_[fake_certificate_index_] : kTestCertificate;
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback,
- certificate_success_,
- certificate));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, certificate_success_, certificate));
++fake_certificate_index_;
}
void FakeSignChallenge(
const cryptohome::AsyncMethodCaller::DataCallback& callback) {
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(callback,
- sign_challenge_success_,
- CreateFakeResponseProto()));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, sign_challenge_success_,
+ CreateFakeResponseProto()));
}
void FakeChallengeCallback(PlatformVerificationFlow::Result result,

Powered by Google App Engine
This is Rietveld 408576698