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

Unified Diff: remoting/base/protocol_decoder_unittest.cc

Issue 3305001: Move decoder into separate thread, clean up API layering, and redo update protocl (Closed)
Patch Set: Fix compile error. Created 10 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/protocol_decoder.cc ('k') | remoting/base/tracer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/protocol_decoder_unittest.cc
diff --git a/remoting/base/protocol_decoder_unittest.cc b/remoting/base/protocol_decoder_unittest.cc
index da13a0d9452dcd22a1ad8af05dd2e0b99c991975..ae4ba85bc0257c7fe3f112e12221ccf6ae08319a 100644
--- a/remoting/base/protocol_decoder_unittest.cc
+++ b/remoting/base/protocol_decoder_unittest.cc
@@ -5,6 +5,7 @@
#include <string>
#include "base/scoped_ptr.h"
+#include "base/stl_util-inl.h"
#include "media/base/data_buffer.h"
#include "remoting/base/protocol_decoder.h"
#include "remoting/base/protocol_util.h"
@@ -93,25 +94,28 @@ TEST(ProtocolDecoderTest, BasicOperations) {
// Then verify the decoded messages.
EXPECT_EQ(31u, message_list.size());
ASSERT_TRUE(message_list.size() > 0);
- EXPECT_TRUE(message_list[0]->has_init_client());
- delete message_list[0];
+ EXPECT_TRUE(message_list.front()->has_init_client());
+ delete message_list.front();
+ message_list.pop_front();
- for (size_t i = 1; i < message_list.size(); ++i) {
+ for (HostMessageList::iterator it = message_list.begin();
+ it != message_list.end(); ++it) {
+ ChromotingHostMessage* message = *it;
int type = (i - 1) % 3;
if (type == 0) {
// Begin update stream.
- EXPECT_TRUE(message_list[i]->has_begin_update_stream());
+ EXPECT_TRUE(message->has_begin_update_stream());
} else if (type == 1) {
// Partial update stream.
- EXPECT_TRUE(message_list[i]->has_update_stream_packet());
+ EXPECT_TRUE(message->has_update_stream_packet());
EXPECT_EQ(kTestData,
- message_list[i]->update_stream_packet().rect_data().data());
+ message->update_stream_packet().rect_data().data());
} else if (type == 2) {
// End update stream.
- EXPECT_TRUE(message_list[i]->has_end_update_stream());
+ EXPECT_TRUE(message->has_end_update_stream());
}
- delete message_list[i];
}
+ STLDeleteElements(&message_list);
}
} // namespace remoting
« no previous file with comments | « remoting/base/protocol_decoder.cc ('k') | remoting/base/tracer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698