| OLD | NEW |
| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 struct Properties : public dbus::PropertySet { | 29 struct Properties : public dbus::PropertySet { |
| 30 dbus::Property<std::string> name; | 30 dbus::Property<std::string> name; |
| 31 dbus::Property<int16> version; | 31 dbus::Property<int16> version; |
| 32 dbus::Property<std::vector<std::string> > methods; | 32 dbus::Property<std::vector<std::string> > methods; |
| 33 dbus::Property<std::vector<dbus::ObjectPath> > objects; | 33 dbus::Property<std::vector<dbus::ObjectPath> > objects; |
| 34 | 34 |
| 35 Properties(dbus::ObjectProxy* object_proxy, | 35 Properties(dbus::ObjectProxy* object_proxy, |
| 36 PropertyChangedCallback property_changed_callback) | 36 PropertyChangedCallback property_changed_callback) |
| 37 : dbus::PropertySet(object_proxy, | 37 : dbus::PropertySet(object_proxy, |
| 38 "org.chromium.TestService", | 38 "org.chromium.TestInterface", |
| 39 property_changed_callback) { | 39 property_changed_callback) { |
| 40 RegisterProperty("Name", &name); | 40 RegisterProperty("Name", &name); |
| 41 RegisterProperty("Version", &version); | 41 RegisterProperty("Version", &version); |
| 42 RegisterProperty("Methods", &methods); | 42 RegisterProperty("Methods", &methods); |
| 43 RegisterProperty("Objects", &objects); | 43 RegisterProperty("Objects", &objects); |
| 44 } | 44 } |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 virtual void SetUp() { | 47 virtual void SetUp() { |
| 48 // Make the main thread not to allow IO. | 48 // Make the main thread not to allow IO. |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 base::Bind(&PropertyTest::PropertyCallback, | 238 base::Bind(&PropertyTest::PropertyCallback, |
| 239 base::Unretained(this), | 239 base::Unretained(this), |
| 240 "Set")); | 240 "Set")); |
| 241 WaitForCallback("Set"); | 241 WaitForCallback("Set"); |
| 242 | 242 |
| 243 // TestService sends a property update. | 243 // TestService sends a property update. |
| 244 WaitForUpdates(1); | 244 WaitForUpdates(1); |
| 245 | 245 |
| 246 EXPECT_EQ("NewService", properties_->name.value()); | 246 EXPECT_EQ("NewService", properties_->name.value()); |
| 247 } | 247 } |
| OLD | NEW |