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

Side by Side Diff: dbus/object_manager_unittest.cc

Issue 177703006: dbus: Handle NameOwnerChanged in ObjectManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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.cc ('k') | dbus/test_service.h » ('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) 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
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
OLDNEW
« no previous file with comments | « dbus/object_manager.cc ('k') | dbus/test_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698