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

Side by Side Diff: remoting/host/host_key_pair_unittest.cc

Issue 11364031: remoting: Update calls froms RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
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 <string> 5 #include <string>
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/scoped_temp_dir.h" 10 #include "base/scoped_temp_dir.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 scoped_ptr<JsonHostConfig> config_; 42 scoped_ptr<JsonHostConfig> config_;
43 }; 43 };
44 44
45 TEST_F(HostKeyPairTest, SaveLoad) { 45 TEST_F(HostKeyPairTest, SaveLoad) {
46 // Save a key to a config, then load it back, and verify that we 46 // Save a key to a config, then load it back, and verify that we
47 // generate the same signature with both keys. 47 // generate the same signature with both keys.
48 HostKeyPair exported_key; 48 HostKeyPair exported_key;
49 exported_key.LoadFromString(kTestHostKeyPair); 49 exported_key.LoadFromString(kTestHostKeyPair);
50 exported_key.Save(config_.get()); 50 exported_key.Save(config_.get());
51 51
52 message_loop_.RunAllPending(); 52 message_loop_.RunUntilIdle();
53 53
54 HostKeyPair imported_key; 54 HostKeyPair imported_key;
55 imported_key.Load(*config_); 55 imported_key.Load(*config_);
56 56
57 ASSERT_EQ(exported_key.GetSignature(kTestMessage), 57 ASSERT_EQ(exported_key.GetSignature(kTestMessage),
58 imported_key.GetSignature(kTestMessage)); 58 imported_key.GetSignature(kTestMessage));
59 } 59 }
60 60
61 TEST_F(HostKeyPairTest, Signatures) { 61 TEST_F(HostKeyPairTest, Signatures) {
62 // Sign a message and check that we get expected signature. 62 // Sign a message and check that we get expected signature.
63 HostKeyPair key_pair; 63 HostKeyPair key_pair;
64 key_pair.LoadFromString(kTestHostKeyPair); 64 key_pair.LoadFromString(kTestHostKeyPair);
65 65
66 std::string signature_base64 = key_pair.GetSignature(kTestMessage); 66 std::string signature_base64 = key_pair.GetSignature(kTestMessage);
67 ASSERT_EQ(signature_base64, std::string(kExpectedSignature)); 67 ASSERT_EQ(signature_base64, std::string(kExpectedSignature));
68 } 68 }
69 69
70 } // namespace remoting 70 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/heartbeat_sender_unittest.cc ('k') | remoting/host/register_support_host_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698