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

Side by Side Diff: chromeos/dbus/cryptohome_client.cc

Issue 12223011: Added more default expectations to MockDBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed link Created 7 years, 10 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
« no previous file with comments | « no previous file | chromeos/dbus/mock_dbus_thread_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chromeos/dbus/cryptohome_client.h" 5 #include "chromeos/dbus/cryptohome_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chromeos/cryptohome/async_method_caller.h" 9 #include "chromeos/cryptohome/async_method_caller.h"
10 #include "chromeos/dbus/blocking_method_caller.h" 10 #include "chromeos/dbus/blocking_method_caller.h"
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 const char kStubSystemSalt[] = "stub_system_salt"; 620 const char kStubSystemSalt[] = "stub_system_salt";
621 salt->assign(kStubSystemSalt, 621 salt->assign(kStubSystemSalt,
622 kStubSystemSalt + arraysize(kStubSystemSalt)); 622 kStubSystemSalt + arraysize(kStubSystemSalt));
623 return true; 623 return true;
624 } 624 }
625 625
626 // CryptohomeClient override. 626 // CryptohomeClient override.
627 virtual void GetSanitizedUsername( 627 virtual void GetSanitizedUsername(
628 const std::string& username, 628 const std::string& username,
629 const StringDBusMethodCallback& callback) OVERRIDE { 629 const StringDBusMethodCallback& callback) OVERRIDE {
630 const char kStubSanitizedUsername[] = 630 const std::string kStubSanitizedUsername(
631 "0123456789ABCDEF0123456789ABCDEF01234567"; 631 "0123456789ABCDEF0123456789ABCDEF01234567");
632 MessageLoop::current()->PostTask( 632 MessageLoop::current()->PostTask(
633 FROM_HERE, 633 FROM_HERE,
634 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, kStubSanitizedUsername)); 634 base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, kStubSanitizedUsername));
635 } 635 }
636 636
637 // CryptohomeClient override. 637 // CryptohomeClient override.
638 virtual void AsyncMount(const std::string& username, 638 virtual void AsyncMount(const std::string& username,
639 const std::string& key, 639 const std::string& key,
640 int flags, 640 int flags,
641 const AsyncMethodCallback& callback) OVERRIDE { 641 const AsyncMethodCallback& callback) OVERRIDE {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 // static 860 // static
861 CryptohomeClient* CryptohomeClient::Create(DBusClientImplementationType type, 861 CryptohomeClient* CryptohomeClient::Create(DBusClientImplementationType type,
862 dbus::Bus* bus) { 862 dbus::Bus* bus) {
863 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 863 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
864 return new CryptohomeClientImpl(bus); 864 return new CryptohomeClientImpl(bus);
865 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 865 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
866 return new CryptohomeClientStubImpl(); 866 return new CryptohomeClientStubImpl();
867 } 867 }
868 868
869 } // namespace chromeos 869 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/dbus/mock_dbus_thread_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698