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

Side by Side Diff: media/audio/cross_process_notification_unittest.cc

Issue 10029005: Update uses of TimeDelta in audio code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase onto master. Created 8 years, 8 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 | media/audio/win/audio_low_latency_input_win_unittest.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) 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 #include "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/shared_memory.h" 7 #include "base/shared_memory.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/test/multiprocess_test.h" 9 #include "base/test/multiprocess_test.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 DCHECK(ok); 403 DCHECK(ok);
404 if (!ok) { 404 if (!ok) {
405 LOG(ERROR) << "Failed to open shared memory segment."; 405 LOG(ERROR) << "Failed to open shared memory segment.";
406 return -1; 406 return -1;
407 } 407 }
408 408
409 mem.Map(CrossProcessNotificationMultiProcessTest::kSharedMemSize); 409 mem.Map(CrossProcessNotificationMultiProcessTest::kSharedMemSize);
410 CrudeIpc* ipc = reinterpret_cast<CrudeIpc*>(mem.memory()); 410 CrudeIpc* ipc = reinterpret_cast<CrudeIpc*>(mem.memory());
411 411
412 while (!ipc->ready) 412 while (!ipc->ready)
413 base::PlatformThread::Sleep(10); 413 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(10));
414 414
415 CrossProcessNotification notifier(ipc->handle_1, ipc->handle_2); 415 CrossProcessNotification notifier(ipc->handle_1, ipc->handle_2);
416 notifier.Wait(); 416 notifier.Wait();
417 notifier.Signal(); 417 notifier.Signal();
418 418
419 return 0; 419 return 0;
420 } 420 }
421 421
422 // Spawns a new process and hands a CrossProcessNotification instance to the 422 // Spawns a new process and hands a CrossProcessNotification instance to the
423 // new process. Once that's done, it waits for the child process to signal 423 // new process. Once that's done, it waits for the child process to signal
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 456
457 ipc->ready = true; 457 ipc->ready = true;
458 458
459 a.Signal(); 459 a.Signal();
460 a.Wait(); 460 a.Wait();
461 461
462 int exit_code = -1; 462 int exit_code = -1;
463 base::WaitForExitCode(process, &exit_code); 463 base::WaitForExitCode(process, &exit_code);
464 EXPECT_EQ(0, exit_code); 464 EXPECT_EQ(0, exit_code);
465 } 465 }
OLDNEW
« no previous file with comments | « no previous file | media/audio/win/audio_low_latency_input_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698