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

Side by Side Diff: chrome/browser/chromeos/cros/mock_cryptohome_library.h

Issue 7891021: Use stub impl when libcros fails to load (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase with power library changes Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_
6 #define CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_ 6 #define CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "chrome/browser/chromeos/cros/cryptohome_library.h" 11 #include "chrome/browser/chromeos/cros/cryptohome_library.h"
12 #include "testing/gmock/include/gmock/gmock.h" 12 #include "testing/gmock/include/gmock/gmock.h"
13 13
14 using ::testing::Invoke; 14 using ::testing::Invoke;
15 using ::testing::WithArgs; 15 using ::testing::WithArgs;
16 using ::testing::_; 16 using ::testing::_;
17 17
18 namespace chromeos { 18 namespace chromeos {
19 19
20 class MockCryptohomeLibrary : public CryptohomeLibrary { 20 class MockCryptohomeLibrary : public CryptohomeLibrary {
21 public: 21 public:
22 MockCryptohomeLibrary(); 22 MockCryptohomeLibrary();
23 virtual ~MockCryptohomeLibrary(); 23 virtual ~MockCryptohomeLibrary();
24 24
25 void SetUp(bool outcome, int code); 25 void SetUp(bool outcome, int code);
26 26
27 MOCK_METHOD0(Init, void(void));
27 MOCK_METHOD2(CheckKey, bool(const std::string& user_email, 28 MOCK_METHOD2(CheckKey, bool(const std::string& user_email,
28 const std::string& passhash)); 29 const std::string& passhash));
29 MOCK_METHOD3(AsyncCheckKey, bool(const std::string& user_email, 30 MOCK_METHOD3(AsyncCheckKey, bool(const std::string& user_email,
30 const std::string& passhash, 31 const std::string& passhash,
31 Delegate* callback)); 32 Delegate* callback));
32 MOCK_METHOD3(MigrateKey, bool(const std::string& user_email, 33 MOCK_METHOD3(MigrateKey, bool(const std::string& user_email,
33 const std::string& old_hash, 34 const std::string& old_hash,
34 const std::string& new_hash)); 35 const std::string& new_hash));
35 MOCK_METHOD4(AsyncMigrateKey, bool(const std::string& user_email, 36 MOCK_METHOD4(AsyncMigrateKey, bool(const std::string& user_email,
36 const std::string& old_hash, 37 const std::string& old_hash,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 86
86 private: 87 private:
87 bool outcome_; 88 bool outcome_;
88 int code_; 89 int code_;
89 DISALLOW_COPY_AND_ASSIGN(MockCryptohomeLibrary); 90 DISALLOW_COPY_AND_ASSIGN(MockCryptohomeLibrary);
90 }; 91 };
91 92
92 } // namespace chromeos 93 } // namespace chromeos
93 94
94 #endif // CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_ 95 #endif // CHROME_BROWSER_CHROMEOS_CROS_MOCK_CRYPTOHOME_LIBRARY_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/login_library.cc ('k') | chrome/browser/chromeos/cros/mock_login_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698