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

Side by Side Diff: remoting/host/security_key/remote_security_key_ipc_client_unittest.cc

Issue 2003753002: Fix remoting_unittests that are failing on 32-bit linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed g_type_init changes Created 4 years, 6 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 | remoting/host/security_key/remote_security_key_ipc_constants.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 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 "remoting/host/security_key/remote_security_key_ipc_client.h" 5 #include "remoting/host/security_key/remote_security_key_ipc_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/run_loop.h" 13 #include "base/run_loop.h"
14 #include "ipc/ipc_channel.h" 14 #include "ipc/ipc_channel.h"
15 #include "remoting/host/security_key/fake_ipc_gnubby_auth_handler.h" 15 #include "remoting/host/security_key/fake_ipc_gnubby_auth_handler.h"
16 #include "remoting/host/security_key/fake_remote_security_key_ipc_server.h" 16 #include "remoting/host/security_key/fake_remote_security_key_ipc_server.h"
17 #include "remoting/host/security_key/remote_security_key_ipc_constants.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 19
19 namespace { 20 namespace {
20 const int kTestConnectionId = 1; 21 const int kTestConnectionId = 1;
21 const char kNonexistentIpcChannelName[] = "Nonexistent_IPC_Channel"; 22 const char kNonexistentIpcChannelName[] = "Nonexistent_IPC_Channel";
22 const char kValidIpcChannelName[] = 23 const char kValidIpcChannelName[] =
23 "Remote_Security_Key_Ipc_Client_Test_Channel."; 24 "Remote_Security_Key_Ipc_Client_Test_Channel.";
24 const int kLargeMessageSizeBytes = 256 * 1024; 25 const int kLargeMessageSizeBytes = 256 * 1024;
25 } // namespace 26 } // namespace
26 27
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 OperationComplete(/*failed=*/false); 141 OperationComplete(/*failed=*/false);
141 } 142 }
142 143
143 void RemoteSecurityKeyIpcClientTest::ClientMessageReceived( 144 void RemoteSecurityKeyIpcClientTest::ClientMessageReceived(
144 const std::string& response_payload) { 145 const std::string& response_payload) {
145 last_message_received_ = response_payload; 146 last_message_received_ = response_payload;
146 OperationComplete(/*failed=*/false); 147 OperationComplete(/*failed=*/false);
147 } 148 }
148 149
149 std::string RemoteSecurityKeyIpcClientTest::GenerateUniqueTestChannelName() { 150 std::string RemoteSecurityKeyIpcClientTest::GenerateUniqueTestChannelName() {
150 return kValidIpcChannelName + IPC::Channel::GenerateUniqueRandomChannelID(); 151 return GetChannelNamePathPrefixForTest() + kValidIpcChannelName +
152 IPC::Channel::GenerateUniqueRandomChannelID();
151 } 153 }
152 154
153 void RemoteSecurityKeyIpcClientTest::EstablishConnection(bool expect_success) { 155 void RemoteSecurityKeyIpcClientTest::EstablishConnection(bool expect_success) {
154 // Start up the security key forwarding session IPC channel first, that way 156 // Start up the security key forwarding session IPC channel first, that way
155 // we can provide the channel using the fake GnubbyAuthHandler later on. 157 // we can provide the channel using the fake GnubbyAuthHandler later on.
156 std::string ipc_session_channel_name = GenerateUniqueTestChannelName(); 158 std::string ipc_session_channel_name = GenerateUniqueTestChannelName();
157 ASSERT_TRUE(fake_ipc_server_.CreateChannel( 159 ASSERT_TRUE(fake_ipc_server_.CreateChannel(
158 ipc_session_channel_name, 160 ipc_session_channel_name,
159 /*request_timeout=*/base::TimeDelta::FromMilliseconds(500))); 161 /*request_timeout=*/base::TimeDelta::FromMilliseconds(500)));
160 ASSERT_TRUE(IPC::Channel::IsNamedServerInitialized(ipc_session_channel_name)); 162 ASSERT_TRUE(IPC::Channel::IsNamedServerInitialized(ipc_session_channel_name));
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 remote_security_key_ipc_client_.SetExpectedIpcServerSessionIdForTest( 345 remote_security_key_ipc_client_.SetExpectedIpcServerSessionIdForTest(
344 session_id_ + 1); 346 session_id_ + 1);
345 347
346 // Attempting to establish a connection should fail here since the IPC Server 348 // Attempting to establish a connection should fail here since the IPC Server
347 // is 'running' in a different session than expected. 349 // is 'running' in a different session than expected.
348 EstablishConnection(/*expect_success=*/false); 350 EstablishConnection(/*expect_success=*/false);
349 } 351 }
350 #endif // defined(OS_WIN) 352 #endif // defined(OS_WIN)
351 353
352 } // namespace remoting 354 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/host/security_key/remote_security_key_ipc_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698