OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/object_manager.h" | 5 #include "dbus/object_manager.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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 object_paths = object_manager_->GetObjects(); | 326 object_paths = object_manager_->GetObjects(); |
327 ASSERT_EQ(1U, object_paths.size()); | 327 ASSERT_EQ(1U, object_paths.size()); |
328 EXPECT_EQ(ObjectPath("/org/chromium/TestObject"), object_paths[0]); | 328 EXPECT_EQ(ObjectPath("/org/chromium/TestObject"), object_paths[0]); |
329 | 329 |
330 object_paths = | 330 object_paths = |
331 object_manager_->GetObjectsWithInterface("org.chromium.TestInterface"); | 331 object_manager_->GetObjectsWithInterface("org.chromium.TestInterface"); |
332 ASSERT_EQ(1U, object_paths.size()); | 332 ASSERT_EQ(1U, object_paths.size()); |
333 EXPECT_EQ(ObjectPath("/org/chromium/TestObject"), object_paths[0]); | 333 EXPECT_EQ(ObjectPath("/org/chromium/TestObject"), object_paths[0]); |
334 } | 334 } |
335 | 335 |
| 336 TEST_F(ObjectManagerTest, OwnershipLost) { |
| 337 PerformAction("ReleaseOwnership", ObjectPath("/org/chromium/TestService")); |
| 338 WaitForRemoveObject(); |
| 339 |
| 340 std::vector<ObjectPath> object_paths = object_manager_->GetObjects(); |
| 341 ASSERT_EQ(0U, object_paths.size()); |
| 342 } |
| 343 |
| 344 TEST_F(ObjectManagerTest, OwnershipLostAndRegained) { |
| 345 PerformAction("Ownership", ObjectPath("/org/chromium/TestService")); |
| 346 WaitForRemoveObject(); |
| 347 WaitForObject(); |
| 348 |
| 349 std::vector<ObjectPath> object_paths = object_manager_->GetObjects(); |
| 350 ASSERT_EQ(1U, object_paths.size()); |
| 351 } |
| 352 |
336 } // namespace dbus | 353 } // namespace dbus |
OLD | NEW |