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

Side by Side Diff: ipc/ipc_sync_channel_unittest.cc

Issue 9148039: Convert use of int ms to TimeDelta in files owned by jeremy. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove static class initialization. Created 8 years, 11 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 | « ipc/ipc_logging.cc ('k') | ipc/ipc_tests.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Unit test for SyncChannel. 5 // Unit test for SyncChannel.
6 6
7 #include "ipc/ipc_sync_channel.h" 7 #include "ipc/ipc_sync_channel.h"
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 SendWithTimeoutMixedOKAndTimeout(false); 1027 SendWithTimeoutMixedOKAndTimeout(false);
1028 SendWithTimeoutMixedOKAndTimeout(true); 1028 SendWithTimeoutMixedOKAndTimeout(true);
1029 } 1029 }
1030 1030
1031 //------------------------------------------------------------------------------ 1031 //------------------------------------------------------------------------------
1032 1032
1033 namespace { 1033 namespace {
1034 1034
1035 void NestedCallback(Worker* server) { 1035 void NestedCallback(Worker* server) {
1036 // Sleep a bit so that we wake up after the reply has been received. 1036 // Sleep a bit so that we wake up after the reply has been received.
1037 base::PlatformThread::Sleep(250); 1037 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(250));
1038 server->SendAnswerToLife(true, base::kNoTimeout, true); 1038 server->SendAnswerToLife(true, base::kNoTimeout, true);
1039 } 1039 }
1040 1040
1041 bool timeout_occurred = false; 1041 bool timeout_occurred = false;
1042 1042
1043 void TimeoutCallback() { 1043 void TimeoutCallback() {
1044 timeout_occurred = true; 1044 timeout_occurred = true;
1045 } 1045 }
1046 1046
1047 class DoneEventRaceServer : public Worker { 1047 class DoneEventRaceServer : public Worker {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 std::vector<Worker*> workers; 1328 std::vector<Worker*> workers;
1329 workers.push_back(new NonRestrictedDispatchServer); 1329 workers.push_back(new NonRestrictedDispatchServer);
1330 workers.push_back(server); 1330 workers.push_back(server);
1331 workers.push_back( 1331 workers.push_back(
1332 new RestrictedDispatchClient(&sent_ping_event, server, &success)); 1332 new RestrictedDispatchClient(&sent_ping_event, server, &success));
1333 RunTest(workers); 1333 RunTest(workers);
1334 EXPECT_EQ(3, success); 1334 EXPECT_EQ(3, success);
1335 } 1335 }
1336 1336
1337 } // namespace IPC 1337 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_logging.cc ('k') | ipc/ipc_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698