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

Side by Side Diff: remoting/protocol/rtp_video_writer_unittest.cc

Issue 7633009: Use MessageLoopProxy for network message loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 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 | « remoting/protocol/rtp_video_writer.cc ('k') | remoting/protocol/rtp_writer.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/message_loop_proxy.h"
10 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
11 #include "remoting/base/constants.h" 12 #include "remoting/base/constants.h"
12 #include "remoting/proto/video.pb.h" 13 #include "remoting/proto/video.pb.h"
13 #include "remoting/protocol/fake_session.h" 14 #include "remoting/protocol/fake_session.h"
14 #include "remoting/protocol/rtp_reader.h" 15 #include "remoting/protocol/rtp_reader.h"
15 #include "remoting/protocol/rtp_utils.h" 16 #include "remoting/protocol/rtp_utils.h"
16 #include "remoting/protocol/rtp_video_writer.h" 17 #include "remoting/protocol/rtp_video_writer.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 19
19 using net::IOBuffer; 20 using net::IOBuffer;
(...skipping 30 matching lines...) Expand all
50 } // namespace 51 } // namespace
51 52
52 class RtpVideoWriterTest : public testing::Test { 53 class RtpVideoWriterTest : public testing::Test {
53 protected: 54 protected:
54 struct ExpectedPacket { 55 struct ExpectedPacket {
55 bool first; 56 bool first;
56 Vp8Descriptor::FragmentationInfo fragmentation_info; 57 Vp8Descriptor::FragmentationInfo fragmentation_info;
57 bool last; 58 bool last;
58 }; 59 };
59 60
61 RtpVideoWriterTest()
62 : writer_(base::MessageLoopProxy::CreateForCurrentThread()) {
63 }
64
60 virtual void SetUp() { 65 virtual void SetUp() {
61 session_.reset(new FakeSession()); 66 session_.reset(new FakeSession());
62 writer_.Init(session_.get(), 67 writer_.Init(session_.get(),
63 base::Bind(&RtpVideoWriterTest::OnWriterInitialized, 68 base::Bind(&RtpVideoWriterTest::OnWriterInitialized,
64 base::Unretained(this))); 69 base::Unretained(this)));
65 } 70 }
66 71
67 void OnWriterInitialized(bool success) { 72 void OnWriterInitialized(bool success) {
68 ASSERT_TRUE(success); 73 ASSERT_TRUE(success);
69 } 74 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 ExpectedPacket expected[] = { 183 ExpectedPacket expected[] = {
179 { true, Vp8Descriptor::FIRST_FRAGMENT, false }, 184 { true, Vp8Descriptor::FIRST_FRAGMENT, false },
180 { false, Vp8Descriptor::MIDDLE_FRAGMENT, false }, 185 { false, Vp8Descriptor::MIDDLE_FRAGMENT, false },
181 { false, Vp8Descriptor::LAST_FRAGMENT, true }, 186 { false, Vp8Descriptor::LAST_FRAGMENT, true },
182 }; 187 };
183 VerifyResult(expected, arraysize(expected)); 188 VerifyResult(expected, arraysize(expected));
184 } 189 }
185 190
186 } // namespace protocol 191 } // namespace protocol
187 } // namespace remoting 192 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/rtp_video_writer.cc ('k') | remoting/protocol/rtp_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698