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

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

Issue 2333923004: Extracting NetLog inner classes into their own classes. (Closed)
Patch Set: Some nit fixes and better, impl-agnostic naming of net_log_parameters_callback_typedef.h -> net/log… Created 4 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 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 test_message.set_payload_utf8("payload"); 85 test_message.set_payload_utf8("payload");
86 return test_message; 86 return test_message;
87 } 87 }
88 88
89 class MockTCPSocket : public net::TCPClientSocket { 89 class MockTCPSocket : public net::TCPClientSocket {
90 public: 90 public:
91 explicit MockTCPSocket(const net::MockConnect& connect_data) 91 explicit MockTCPSocket(const net::MockConnect& connect_data)
92 : TCPClientSocket(net::AddressList(), 92 : TCPClientSocket(net::AddressList(),
93 nullptr, 93 nullptr,
94 nullptr, 94 nullptr,
95 net::NetLog::Source()), 95 net::NetLogSource()),
96 connect_data_(connect_data), 96 connect_data_(connect_data),
97 do_nothing_(false) {} 97 do_nothing_(false) {}
98 98
99 explicit MockTCPSocket(bool do_nothing) 99 explicit MockTCPSocket(bool do_nothing)
100 : TCPClientSocket(net::AddressList(), 100 : TCPClientSocket(net::AddressList(),
101 nullptr, 101 nullptr,
102 nullptr, 102 nullptr,
103 net::NetLog::Source()) { 103 net::NetLogSource()) {
104 CHECK(do_nothing); 104 CHECK(do_nothing);
105 do_nothing_ = do_nothing; 105 do_nothing_ = do_nothing;
106 } 106 }
107 107
108 virtual int Connect(const net::CompletionCallback& callback) { 108 virtual int Connect(const net::CompletionCallback& callback) {
109 if (do_nothing_) { 109 if (do_nothing_) {
110 // Stall the I/O event loop. 110 // Stall the I/O event loop.
111 return net::ERR_IO_PENDING; 111 return net::ERR_IO_PENDING;
112 } 112 }
113 113
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 logger_, cast_channel::CastDeviceCapability::VIDEO_OUT); 904 logger_, cast_channel::CastDeviceCapability::VIDEO_OUT);
905 EXPECT_FALSE(socket_->audio_only()); 905 EXPECT_FALSE(socket_->audio_only());
906 EXPECT_TRUE(socket_->TestVerifyChannelPolicyNone()); 906 EXPECT_TRUE(socket_->TestVerifyChannelPolicyNone());
907 EXPECT_FALSE(socket_->audio_only()); 907 EXPECT_FALSE(socket_->audio_only());
908 EXPECT_FALSE(socket_->TestVerifyChannelPolicyAudioOnly()); 908 EXPECT_FALSE(socket_->TestVerifyChannelPolicyAudioOnly());
909 EXPECT_TRUE(socket_->audio_only()); 909 EXPECT_TRUE(socket_->audio_only());
910 } 910 }
911 } // namespace cast_channel 911 } // namespace cast_channel
912 } // namespace api 912 } // namespace api
913 } // namespace extensions 913 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698