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

Side by Side Diff: extensions/browser/api/cast_channel/cast_socket_unittest.cc

Issue 1376473003: Notify NQE of TCP RTT values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reorder initialization in constructor 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
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 "extensions/browser/api/cast_channel/cast_socket.h" 5 #include "extensions/browser/api/cast_channel/cast_socket.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 test_message.set_source_id("source"); 76 test_message.set_source_id("source");
77 test_message.set_destination_id("dest"); 77 test_message.set_destination_id("dest");
78 test_message.set_payload_type(CastMessage::STRING); 78 test_message.set_payload_type(CastMessage::STRING);
79 test_message.set_payload_utf8("payload"); 79 test_message.set_payload_utf8("payload");
80 return test_message; 80 return test_message;
81 } 81 }
82 82
83 class MockTCPSocket : public net::TCPClientSocket { 83 class MockTCPSocket : public net::TCPClientSocket {
84 public: 84 public:
85 explicit MockTCPSocket(const net::MockConnect& connect_data) 85 explicit MockTCPSocket(const net::MockConnect& connect_data)
86 : TCPClientSocket(net::AddressList(), nullptr, net::NetLog::Source()), 86 : TCPClientSocket(net::AddressList(),
87 nullptr,
88 nullptr,
89 net::NetLog::Source()),
87 connect_data_(connect_data), 90 connect_data_(connect_data),
88 do_nothing_(false) {} 91 do_nothing_(false) {}
89 92
90 explicit MockTCPSocket(bool do_nothing) 93 explicit MockTCPSocket(bool do_nothing)
91 : TCPClientSocket(net::AddressList(), nullptr, net::NetLog::Source()) { 94 : TCPClientSocket(net::AddressList(),
95 nullptr,
96 nullptr,
97 net::NetLog::Source()) {
92 CHECK(do_nothing); 98 CHECK(do_nothing);
93 do_nothing_ = do_nothing; 99 do_nothing_ = do_nothing;
94 } 100 }
95 101
96 virtual int Connect(const net::CompletionCallback& callback) { 102 virtual int Connect(const net::CompletionCallback& callback) {
97 if (do_nothing_) { 103 if (do_nothing_) {
98 // Stall the I/O event loop. 104 // Stall the I/O event loop.
99 return net::ERR_IO_PENDING; 105 return net::ERR_IO_PENDING;
100 } 106 }
101 107
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 logger_, cast_channel::CastDeviceCapability::VIDEO_OUT); 885 logger_, cast_channel::CastDeviceCapability::VIDEO_OUT);
880 EXPECT_FALSE(socket_->audio_only()); 886 EXPECT_FALSE(socket_->audio_only());
881 EXPECT_TRUE(socket_->TestVerifyChannelPolicyNone()); 887 EXPECT_TRUE(socket_->TestVerifyChannelPolicyNone());
882 EXPECT_FALSE(socket_->audio_only()); 888 EXPECT_FALSE(socket_->audio_only());
883 EXPECT_FALSE(socket_->TestVerifyChannelPolicyAudioOnly()); 889 EXPECT_FALSE(socket_->TestVerifyChannelPolicyAudioOnly());
884 EXPECT_TRUE(socket_->audio_only()); 890 EXPECT_TRUE(socket_->audio_only());
885 } 891 }
886 } // namespace cast_channel 892 } // namespace cast_channel
887 } // namespace api 893 } // namespace api
888 } // namespace extensions 894 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/cast_channel/cast_socket.cc ('k') | extensions/browser/api/socket/tcp_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698