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

Side by Side Diff: dbus/property_unittest.cc

Issue 1179163002: Migrate callers of message_loop_proxy() to task_runner() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 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 | « dbus/object_manager_unittest.cc ('k') | dbus/signal_sender_verification_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 "dbus/property.h" 5 #include "dbus/property.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 base::ThreadRestrictions::SetIOAllowed(false); 54 base::ThreadRestrictions::SetIOAllowed(false);
55 55
56 // Start the D-Bus thread. 56 // Start the D-Bus thread.
57 dbus_thread_.reset(new base::Thread("D-Bus Thread")); 57 dbus_thread_.reset(new base::Thread("D-Bus Thread"));
58 base::Thread::Options thread_options; 58 base::Thread::Options thread_options;
59 thread_options.message_loop_type = base::MessageLoop::TYPE_IO; 59 thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
60 ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options)); 60 ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options));
61 61
62 // Start the test service, using the D-Bus thread. 62 // Start the test service, using the D-Bus thread.
63 TestService::Options options; 63 TestService::Options options;
64 options.dbus_task_runner = dbus_thread_->message_loop_proxy(); 64 options.dbus_task_runner = dbus_thread_->task_runner();
65 test_service_.reset(new TestService(options)); 65 test_service_.reset(new TestService(options));
66 ASSERT_TRUE(test_service_->StartService()); 66 ASSERT_TRUE(test_service_->StartService());
67 ASSERT_TRUE(test_service_->WaitUntilServiceIsStarted()); 67 ASSERT_TRUE(test_service_->WaitUntilServiceIsStarted());
68 ASSERT_TRUE(test_service_->HasDBusThread()); 68 ASSERT_TRUE(test_service_->HasDBusThread());
69 69
70 // Create the client, using the D-Bus thread. 70 // Create the client, using the D-Bus thread.
71 Bus::Options bus_options; 71 Bus::Options bus_options;
72 bus_options.bus_type = Bus::SESSION; 72 bus_options.bus_type = Bus::SESSION;
73 bus_options.connection_type = Bus::PRIVATE; 73 bus_options.connection_type = Bus::PRIVATE;
74 bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy(); 74 bus_options.dbus_task_runner = dbus_thread_->task_runner();
75 bus_ = new Bus(bus_options); 75 bus_ = new Bus(bus_options);
76 object_proxy_ = bus_->GetObjectProxy( 76 object_proxy_ = bus_->GetObjectProxy(
77 "org.chromium.TestService", 77 "org.chromium.TestService",
78 ObjectPath("/org/chromium/TestObject")); 78 ObjectPath("/org/chromium/TestObject"));
79 ASSERT_TRUE(bus_->HasDBusThread()); 79 ASSERT_TRUE(bus_->HasDBusThread());
80 80
81 // Create the properties structure 81 // Create the properties structure
82 properties_.reset(new Properties( 82 properties_.reset(new Properties(
83 object_proxy_, 83 object_proxy_,
84 base::Bind(&PropertyTest::OnPropertyChanged, 84 base::Bind(&PropertyTest::OnPropertyChanged,
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 Property<std::vector<std::pair<std::vector<uint8>, uint16>>> ip_list; 422 Property<std::vector<std::pair<std::vector<uint8>, uint16>>> ip_list;
423 ip_list.ReplaceSetValueForTesting(test_list); 423 ip_list.ReplaceSetValueForTesting(test_list);
424 ip_list.AppendSetValueToWriter(&writer); 424 ip_list.AppendSetValueToWriter(&writer);
425 425
426 MessageReader reader(message.get()); 426 MessageReader reader(message.get());
427 EXPECT_TRUE(ip_list.PopValueFromReader(&reader)); 427 EXPECT_TRUE(ip_list.PopValueFromReader(&reader));
428 EXPECT_EQ(test_list, ip_list.value()); 428 EXPECT_EQ(test_list, ip_list.value());
429 } 429 }
430 430
431 } // namespace dbus 431 } // namespace dbus
OLDNEW
« no previous file with comments | « dbus/object_manager_unittest.cc ('k') | dbus/signal_sender_verification_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698