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

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_test_utils.h

Issue 821453003: Update legacy Tuple-using code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: media Created 6 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "content/common/p2p_messages.h" 10 #include "content/common/p2p_messages.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 MATCHER_P(MatchMessage, type, "") { 96 MATCHER_P(MatchMessage, type, "") {
97 return arg->type() == type; 97 return arg->type() == type;
98 } 98 }
99 99
100 MATCHER_P(MatchPacketMessage, packet_content, "") { 100 MATCHER_P(MatchPacketMessage, packet_content, "") {
101 if (arg->type() != P2PMsg_OnDataReceived::ID) 101 if (arg->type() != P2PMsg_OnDataReceived::ID)
102 return false; 102 return false;
103 P2PMsg_OnDataReceived::Param params; 103 P2PMsg_OnDataReceived::Param params;
104 P2PMsg_OnDataReceived::Read(arg, &params); 104 P2PMsg_OnDataReceived::Read(arg, &params);
105 return params.c == packet_content; 105 return get<2>(params) == packet_content;
106 } 106 }
107 107
108 MATCHER_P(MatchIncomingSocketMessage, address, "") { 108 MATCHER_P(MatchIncomingSocketMessage, address, "") {
109 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID) 109 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID)
110 return false; 110 return false;
111 P2PMsg_OnIncomingTcpConnection::Param params; 111 P2PMsg_OnIncomingTcpConnection::Param params;
112 P2PMsg_OnIncomingTcpConnection::Read( 112 P2PMsg_OnIncomingTcpConnection::Read(
113 arg, &params); 113 arg, &params);
114 return params.b == address; 114 return get<1>(params) == address;
115 } 115 }
116 116
117 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 117 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698