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

Side by Side Diff: dbus/test_service.cc

Issue 10735022: Switch to TimeDelta interface for TestTimeouts in dbus code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 | no next file » | 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 "dbus/test_service.h" 5 #include "dbus/test_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/test/test_timeouts.h" 8 #include "base/test/test_timeouts.h"
9 #include "base/threading/platform_thread.h" 9 #include "base/threading/platform_thread.h"
10 #include "dbus/bus.h" 10 #include "dbus/bus.h"
(...skipping 24 matching lines...) Expand all
35 Stop(); 35 Stop();
36 } 36 }
37 37
38 bool TestService::StartService() { 38 bool TestService::StartService() {
39 base::Thread::Options thread_options; 39 base::Thread::Options thread_options;
40 thread_options.message_loop_type = MessageLoop::TYPE_IO; 40 thread_options.message_loop_type = MessageLoop::TYPE_IO;
41 return StartWithOptions(thread_options); 41 return StartWithOptions(thread_options);
42 } 42 }
43 43
44 bool TestService::WaitUntilServiceIsStarted() { 44 bool TestService::WaitUntilServiceIsStarted() {
45 const base::TimeDelta timeout( 45 const base::TimeDelta timeout(TestTimeouts::action_max_timeout());
46 base::TimeDelta::FromMilliseconds(
47 TestTimeouts::action_max_timeout_ms()));
48 // Wait until all methods are exported. 46 // Wait until all methods are exported.
49 return on_all_methods_exported_.TimedWait(timeout); 47 return on_all_methods_exported_.TimedWait(timeout);
50 } 48 }
51 49
52 void TestService::ShutdownAndBlock() { 50 void TestService::ShutdownAndBlock() {
53 message_loop()->PostTask( 51 message_loop()->PostTask(
54 FROM_HERE, 52 FROM_HERE,
55 base::Bind(&TestService::ShutdownAndBlockInternal, 53 base::Bind(&TestService::ShutdownAndBlockInternal,
56 base::Unretained(this))); 54 base::Unretained(this)));
57 } 55 }
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 array_writer.OpenDictEntry(&dict_entry_writer); 445 array_writer.OpenDictEntry(&dict_entry_writer);
448 dict_entry_writer.AppendString("Name"); 446 dict_entry_writer.AppendString("Name");
449 dict_entry_writer.AppendVariantOfString(name); 447 dict_entry_writer.AppendVariantOfString(name);
450 array_writer.CloseContainer(&dict_entry_writer); 448 array_writer.CloseContainer(&dict_entry_writer);
451 writer.CloseContainer(&array_writer); 449 writer.CloseContainer(&array_writer);
452 450
453 exported_object_->SendSignal(&signal); 451 exported_object_->SendSignal(&signal);
454 } 452 }
455 453
456 } // namespace dbus 454 } // namespace dbus
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698