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

Side by Side Diff: chromeos/cryptohome/system_salt_getter_unittest.cc

Issue 43503003: chromeos: Remove SystemSaltGetter::GetSystemSaltSync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 7 years, 1 month 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 | « chromeos/cryptohome/system_salt_getter.cc ('k') | chromeos/dbus/cryptohome_client.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/cryptohome/system_salt_getter.h" 5 #include "chromeos/cryptohome/system_salt_getter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chromeos/dbus/fake_cryptohome_client.h" 10 #include "chromeos/dbus/fake_cryptohome_client.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Try to get system salt before the service becomes available. 48 // Try to get system salt before the service becomes available.
49 fake_cryptohome_client_->SetServiceIsAvailable(false); 49 fake_cryptohome_client_->SetServiceIsAvailable(false);
50 std::string system_salt; 50 std::string system_salt;
51 SystemSaltGetter::Get()->GetSystemSalt( 51 SystemSaltGetter::Get()->GetSystemSalt(
52 base::Bind(&CopySystemSalt, &system_salt)); 52 base::Bind(&CopySystemSalt, &system_salt));
53 base::RunLoop().RunUntilIdle(); 53 base::RunLoop().RunUntilIdle();
54 EXPECT_TRUE(system_salt.empty()); // System salt is not returned yet. 54 EXPECT_TRUE(system_salt.empty()); // System salt is not returned yet.
55 55
56 // Service becomes available. 56 // Service becomes available.
57 fake_cryptohome_client_->SetServiceIsAvailable(true); 57 fake_cryptohome_client_->SetServiceIsAvailable(true);
58 base::RunLoop().RunUntilIdle();
hashimoto 2013/10/25 11:06:55 Test was failing because message loop was not run.
58 const std::string expected_system_salt = 59 const std::string expected_system_salt =
59 SystemSaltGetter::ConvertRawSaltToHexString( 60 SystemSaltGetter::ConvertRawSaltToHexString(
60 FakeCryptohomeClient::GetStubSystemSalt()); 61 FakeCryptohomeClient::GetStubSystemSalt());
61 EXPECT_EQ(expected_system_salt, system_salt); // System salt is returned. 62 EXPECT_EQ(expected_system_salt, system_salt); // System salt is returned.
62 } 63 }
63 64
64 } // namespace 65 } // namespace
65 } // namespace chromeos 66 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/cryptohome/system_salt_getter.cc ('k') | chromeos/dbus/cryptohome_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698