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

Side by Side Diff: blimp/client/session/assignment_source_unittest.cc

Issue 2102173003: blimp: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | blimp/engine/app/blimp_url_request_context_getter.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "blimp/client/session/assignment_source.h" 5 #include "blimp/client/session/assignment_source.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 dict->SetString("certificate", cert_pem_); 203 dict->SetString("certificate", cert_pem_);
204 return dict; 204 return dict;
205 } 205 }
206 206
207 TEST_F(AssignmentSourceTest, TestTCPAlternateEndpointSuccess) { 207 TEST_F(AssignmentSourceTest, TestTCPAlternateEndpointSuccess) {
208 Assignment assignment; 208 Assignment assignment;
209 assignment.transport_protocol = Assignment::TransportProtocol::TCP; 209 assignment.transport_protocol = Assignment::TransportProtocol::TCP;
210 assignment.engine_endpoint = net::IPEndPoint(kTestIpAddress, kTestPort); 210 assignment.engine_endpoint = net::IPEndPoint(kTestIpAddress, kTestPort);
211 assignment.cert = scoped_refptr<net::X509Certificate>(nullptr); 211 assignment.cert = scoped_refptr<net::X509Certificate>(nullptr);
212 212
213 auto cmd_line = base::CommandLine::ForCurrentProcess(); 213 auto* cmd_line = base::CommandLine::ForCurrentProcess();
214 cmd_line->AppendSwitchASCII(switches::kEngineIP, kTestIpAddressString); 214 cmd_line->AppendSwitchASCII(switches::kEngineIP, kTestIpAddressString);
215 cmd_line->AppendSwitchASCII(switches::kEnginePort, 215 cmd_line->AppendSwitchASCII(switches::kEnginePort,
216 std::to_string(kTestPort)); 216 std::to_string(kTestPort));
217 cmd_line->AppendSwitchASCII(switches::kEngineTransport, kTcpTransportName); 217 cmd_line->AppendSwitchASCII(switches::kEngineTransport, kTcpTransportName);
218 cmd_line->AppendSwitchASCII(kClientTokenPath, client_token_path_.value()); 218 cmd_line->AppendSwitchASCII(kClientTokenPath, client_token_path_.value());
219 219
220 assignment.client_token = GetClientToken(*cmd_line); 220 assignment.client_token = GetClientToken(*cmd_line);
221 221
222 CHECK_EQ("MyVoiceIsMyPassport", assignment.client_token); 222 CHECK_EQ("MyVoiceIsMyPassport", assignment.client_token);
223 223
224 EXPECT_CALL(*this, AssignmentResponse(AssignmentSource::Result::RESULT_OK, 224 EXPECT_CALL(*this, AssignmentResponse(AssignmentSource::Result::RESULT_OK,
225 AssignmentEquals(assignment))) 225 AssignmentEquals(assignment)))
226 .Times(1); 226 .Times(1);
227 227
228 GetAlternateAssignment(); 228 GetAlternateAssignment();
229 } 229 }
230 230
231 TEST_F(AssignmentSourceTest, TestSSLAlternateEndpointSuccess) { 231 TEST_F(AssignmentSourceTest, TestSSLAlternateEndpointSuccess) {
232 Assignment assignment; 232 Assignment assignment;
233 assignment.transport_protocol = Assignment::TransportProtocol::SSL; 233 assignment.transport_protocol = Assignment::TransportProtocol::SSL;
234 assignment.engine_endpoint = net::IPEndPoint(kTestIpAddress, kTestPort); 234 assignment.engine_endpoint = net::IPEndPoint(kTestIpAddress, kTestPort);
235 assignment.cert = cert_; 235 assignment.cert = cert_;
236 236
237 auto cmd_line = base::CommandLine::ForCurrentProcess(); 237 auto* cmd_line = base::CommandLine::ForCurrentProcess();
238 238
239 cmd_line->AppendSwitchASCII(switches::kEngineIP, kTestIpAddressString); 239 cmd_line->AppendSwitchASCII(switches::kEngineIP, kTestIpAddressString);
240 cmd_line->AppendSwitchASCII(switches::kEnginePort, 240 cmd_line->AppendSwitchASCII(switches::kEnginePort,
241 std::to_string(kTestPort)); 241 std::to_string(kTestPort));
242 cmd_line->AppendSwitchASCII(switches::kEngineTransport, kSslTransportName); 242 cmd_line->AppendSwitchASCII(switches::kEngineTransport, kSslTransportName);
243 cmd_line->AppendSwitchASCII(switches::kEngineCertPath, cert_path_.value()); 243 cmd_line->AppendSwitchASCII(switches::kEngineCertPath, cert_path_.value());
244 cmd_line->AppendSwitchASCII(kClientTokenPath, client_token_path_.value()); 244 cmd_line->AppendSwitchASCII(kClientTokenPath, client_token_path_.value());
245 245
246 assignment.client_token = GetClientToken(*cmd_line); 246 assignment.client_token = GetClientToken(*cmd_line);
247 247
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 EXPECT_CALL(*this, AssignmentResponse( 391 EXPECT_CALL(*this, AssignmentResponse(
392 AssignmentSource::Result::RESULT_INVALID_CERT, _)); 392 AssignmentSource::Result::RESULT_INVALID_CERT, _));
393 GetNetworkAssignmentAndWaitForResponse(net::HTTP_OK, net::Error::OK, 393 GetNetworkAssignmentAndWaitForResponse(net::HTTP_OK, net::Error::OK,
394 ValueToString(*response), 394 ValueToString(*response),
395 kTestAuthToken, kProtocolVersion); 395 kTestAuthToken, kProtocolVersion);
396 } 396 }
397 397
398 } // namespace 398 } // namespace
399 } // namespace client 399 } // namespace client
400 } // namespace blimp 400 } // namespace blimp
OLDNEW
« no previous file with comments | « no previous file | blimp/engine/app/blimp_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698