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

Side by Side Diff: remoting/signaling/log_to_server_unittest.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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
« no previous file with comments | « remoting/signaling/log_to_server.cc ('k') | remoting/signaling/mock_signal_strategy.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "remoting/signaling/log_to_server.h" 5 #include "remoting/signaling/log_to_server.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "remoting/signaling/mock_signal_strategy.h" 9 #include "remoting/signaling/mock_signal_strategy.h"
10 #include "remoting/signaling/server_log_entry_unittest.h" 10 #include "remoting/signaling/server_log_entry_unittest.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 EXPECT_CALL(signal_strategy_, AddListener(_)); 43 EXPECT_CALL(signal_strategy_, AddListener(_));
44 EXPECT_CALL(signal_strategy_, RemoveListener(_)); 44 EXPECT_CALL(signal_strategy_, RemoveListener(_));
45 log_to_server_.reset( 45 log_to_server_.reset(
46 new LogToServer(ServerLogEntry::ME2ME, &signal_strategy_, kTestBotJid)); 46 new LogToServer(ServerLogEntry::ME2ME, &signal_strategy_, kTestBotJid));
47 } 47 }
48 48
49 protected: 49 protected:
50 base::MessageLoop message_loop_; 50 base::MessageLoop message_loop_;
51 base::RunLoop run_loop_; 51 base::RunLoop run_loop_;
52 MockSignalStrategy signal_strategy_; 52 MockSignalStrategy signal_strategy_;
53 scoped_ptr<LogToServer> log_to_server_; 53 std::unique_ptr<LogToServer> log_to_server_;
54 }; 54 };
55 55
56 TEST_F(LogToServerTest, LogWhenConnected) { 56 TEST_F(LogToServerTest, LogWhenConnected) {
57 { 57 {
58 InSequence s; 58 InSequence s;
59 EXPECT_CALL(signal_strategy_, GetLocalJid()) 59 EXPECT_CALL(signal_strategy_, GetLocalJid())
60 .WillRepeatedly(Return(kClientJid)); 60 .WillRepeatedly(Return(kClientJid));
61 EXPECT_CALL(signal_strategy_, AddListener(_)); 61 EXPECT_CALL(signal_strategy_, AddListener(_));
62 EXPECT_CALL(signal_strategy_, GetNextId()); 62 EXPECT_CALL(signal_strategy_, GetNextId());
63 EXPECT_CALL(signal_strategy_, SendStanzaPtr(IsLogEntry("a", "1"))) 63 EXPECT_CALL(signal_strategy_, SendStanzaPtr(IsLogEntry("a", "1")))
(...skipping 20 matching lines...) Expand all
84 .WillRepeatedly(Return(kClientJid)); 84 .WillRepeatedly(Return(kClientJid));
85 EXPECT_CALL(signal_strategy_, SendStanzaPtr(_)).Times(0); 85 EXPECT_CALL(signal_strategy_, SendStanzaPtr(_)).Times(0);
86 86
87 ServerLogEntry entry; 87 ServerLogEntry entry;
88 entry.Set("foo", "bar"); 88 entry.Set("foo", "bar");
89 log_to_server_->Log(entry); 89 log_to_server_->Log(entry);
90 run_loop_.RunUntilIdle(); 90 run_loop_.RunUntilIdle();
91 } 91 }
92 92
93 } // namespace remoting 93 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/signaling/log_to_server.cc ('k') | remoting/signaling/mock_signal_strategy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698