| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chromeos/binder/service_manager_proxy.h" | 5 #include "chromeos/binder/service_manager_proxy.h" |
| 6 | 6 |
| 7 #include "base/guid.h" | 7 #include "base/guid.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 TEST_F(BinderServiceManagerProxyTest, AddAndCheck) { | 53 TEST_F(BinderServiceManagerProxyTest, AddAndCheck) { |
| 54 const base::string16 kServiceName = | 54 const base::string16 kServiceName = |
| 55 base::ASCIIToUTF16("org.chromium.TestService-" + base::GenerateGUID()); | 55 base::ASCIIToUTF16("org.chromium.TestService-" + base::GenerateGUID()); |
| 56 | 56 |
| 57 // Service not available yet. | 57 // Service not available yet. |
| 58 EXPECT_FALSE( | 58 EXPECT_FALSE( |
| 59 ServiceManagerProxy::CheckService(&command_broker_, kServiceName)); | 59 ServiceManagerProxy::CheckService(&command_broker_, kServiceName)); |
| 60 | 60 |
| 61 // Add service. | 61 // Add service. |
| 62 scoped_refptr<Object> object( | 62 scoped_refptr<Object> object( |
| 63 new LocalObject(base::WrapUnique(new DummyTransactionHandler()))); | 63 new LocalObject(base::MakeUnique<DummyTransactionHandler>())); |
| 64 EXPECT_TRUE(ServiceManagerProxy::AddService(&command_broker_, kServiceName, | 64 EXPECT_TRUE(ServiceManagerProxy::AddService(&command_broker_, kServiceName, |
| 65 object, 0)); | 65 object, 0)); |
| 66 | 66 |
| 67 // Service is available. | 67 // Service is available. |
| 68 scoped_refptr<Object> result = | 68 scoped_refptr<Object> result = |
| 69 ServiceManagerProxy::CheckService(&command_broker_, kServiceName); | 69 ServiceManagerProxy::CheckService(&command_broker_, kServiceName); |
| 70 ASSERT_TRUE(result); | 70 ASSERT_TRUE(result); |
| 71 ASSERT_EQ(LocalObject::TYPE_LOCAL, result->GetType()); | 71 ASSERT_EQ(LocalObject::TYPE_LOCAL, result->GetType()); |
| 72 EXPECT_EQ(object.get(), result.get()); | 72 EXPECT_EQ(object.get(), result.get()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace binder | 75 } // namespace binder |
| OLD | NEW |