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

Unified Diff: chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc

Issue 93383002: Changed fake callbacks to post tasks asynchronously. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
diff --git a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
index eccd1205f9bc12accd295fafd3172c08c5b6f8c2..b848f4d36ddd51e288015a6ce8d07a87945e97e2 100644
--- a/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
+++ b/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
@@ -6,6 +6,9 @@
#include <string>
+#include "base/bind.h"
+#include "base/location.h"
+#include "base/message_loop/message_loop_proxy.h"
#include "base/prefs/pref_service.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
@@ -51,7 +54,9 @@ class FakeBoolDBusMethod {
value_(value) {}
void operator() (const chromeos::BoolDBusMethodCallback& callback) {
- callback.Run(status_, value_);
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, status_, value_));
}
private:
@@ -64,7 +69,9 @@ void RegisterKeyCallbackTrue(
const std::string& user_id,
const std::string& key_name,
const cryptohome::AsyncMethodCaller::Callback& callback) {
- callback.Run(true, cryptohome::MOUNT_ERROR_NONE);
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, true, cryptohome::MOUNT_ERROR_NONE));
}
void RegisterKeyCallbackFalse(
@@ -72,7 +79,9 @@ void RegisterKeyCallbackFalse(
const std::string& user_id,
const std::string& key_name,
const cryptohome::AsyncMethodCaller::Callback& callback) {
- callback.Run(false, cryptohome::MOUNT_ERROR_NONE);
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, false, cryptohome::MOUNT_ERROR_NONE));
}
void SignChallengeCallbackTrue(
@@ -84,7 +93,9 @@ void SignChallengeCallbackTrue(
chromeos::attestation::AttestationChallengeOptions options,
const std::string& challenge,
const cryptohome::AsyncMethodCaller::DataCallback& callback) {
- callback.Run(true, "response");
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, true, "response"));
}
void SignChallengeCallbackFalse(
@@ -96,7 +107,9 @@ void SignChallengeCallbackFalse(
chromeos::attestation::AttestationChallengeOptions options,
const std::string& challenge,
const cryptohome::AsyncMethodCaller::DataCallback& callback) {
- callback.Run(false, "");
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, false, ""));
}
void GetCertificateCallbackTrue(
@@ -106,7 +119,9 @@ void GetCertificateCallbackTrue(
bool force_new_key,
const chromeos::attestation::AttestationFlow::CertificateCallback&
callback) {
- callback.Run(true, "certificate");
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, true, "certificate"));
}
void GetCertificateCallbackFalse(
@@ -116,7 +131,9 @@ void GetCertificateCallbackFalse(
bool force_new_key,
const chromeos::attestation::AttestationFlow::CertificateCallback&
callback) {
- callback.Run(false, "");
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, false, ""));
}
class EPKPChallengeKeyTestBase : public BrowserWithTestWindowTest {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698