summaryrefslogtreecommitdiffstats
path: root/chromeos/cryptohome/mock_async_method_caller.h
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-26 12:11:37 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-26 12:11:37 +0000
commit6666e5bf840b8198909a9207604855f4e8dbc2af (patch)
tree007dfbde26855ac2261042045c916b855fe7068e /chromeos/cryptohome/mock_async_method_caller.h
parent278f9ac61cdf6bebaec0be4ec6daab1c1399c2fd (diff)
downloadchromium_src-6666e5bf840b8198909a9207604855f4e8dbc2af.zip
chromium_src-6666e5bf840b8198909a9207604855f4e8dbc2af.tar.gz
chromium_src-6666e5bf840b8198909a9207604855f4e8dbc2af.tar.bz2
chromeos: Move src/chrome/browser/chromeos/cryptohome to src/chromeos
BUG=None TEST=build TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10878061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153410 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/cryptohome/mock_async_method_caller.h')
-rw-r--r--chromeos/cryptohome/mock_async_method_caller.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/chromeos/cryptohome/mock_async_method_caller.h b/chromeos/cryptohome/mock_async_method_caller.h
new file mode 100644
index 0000000..5b301cb
--- /dev/null
+++ b/chromeos/cryptohome/mock_async_method_caller.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_
+#define CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "chromeos/cryptohome/async_method_caller.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace cryptohome {
+
+class MockAsyncMethodCaller : public AsyncMethodCaller {
+ public:
+ MockAsyncMethodCaller();
+ virtual ~MockAsyncMethodCaller();
+
+ void SetUp(bool success, MountError return_code);
+
+ MOCK_METHOD3(AsyncCheckKey, void(const std::string& user_email,
+ const std::string& passhash,
+ Callback callback));
+ MOCK_METHOD4(AsyncMigrateKey, void(const std::string& user_email,
+ const std::string& old_hash,
+ const std::string& new_hash,
+ Callback callback));
+ MOCK_METHOD4(AsyncMount, void(const std::string& user_email,
+ const std::string& passhash,
+ const bool create_if_missing,
+ Callback callback));
+ MOCK_METHOD1(AsyncMountGuest, void(Callback callback));
+ MOCK_METHOD2(AsyncRemove, void(const std::string& user_email,
+ Callback callback));
+
+ private:
+ bool success_;
+ MountError return_code_;
+
+ void DoCallback(Callback callback);
+
+ DISALLOW_COPY_AND_ASSIGN(MockAsyncMethodCaller);
+};
+
+} // namespace cryptohome
+
+#endif // CHROMEOS_CRYPTOHOME_MOCK_ASYNC_METHOD_CALLER_H_