| 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 "base/run_loop.h" | 5 #include "base/run_loop.h" |
| 6 #include "mojo/public/cpp/application/application_impl.h" | |
| 7 #include "mojo/public/cpp/application/application_test_base.h" | 6 #include "mojo/public/cpp/application/application_test_base.h" |
| 8 #include "mojo/public/cpp/application/connect.h" | 7 #include "mojo/public/cpp/application/connect.h" |
| 9 #include "mojo/services/contacts/interfaces/contacts.mojom.h" | 8 #include "mojo/services/contacts/interfaces/contacts.mojom.h" |
| 10 | 9 |
| 11 namespace contacts { | 10 namespace contacts { |
| 12 | 11 |
| 13 class ContactAppTest : public mojo::test::ApplicationTestBase { | 12 class ContactAppTest : public mojo::test::ApplicationTestBase { |
| 14 public: | 13 public: |
| 15 ContactAppTest() : ApplicationTestBase() {} | 14 ContactAppTest() : ApplicationTestBase() {} |
| 16 ~ContactAppTest() override {} | 15 ~ContactAppTest() override {} |
| 17 | 16 |
| 18 void SetUp() override { | 17 void SetUp() override { |
| 19 mojo::test::ApplicationTestBase::SetUp(); | 18 mojo::test::ApplicationTestBase::SetUp(); |
| 20 mojo::ConnectToService(application_impl()->shell(), "mojo:contacts", | 19 mojo::ConnectToService(shell(), "mojo:contacts", |
| 21 GetProxy(&contacts_service_)); | 20 GetProxy(&contacts_service_)); |
| 22 } | 21 } |
| 23 | 22 |
| 24 protected: | 23 protected: |
| 25 contacts::ContactsServicePtr contacts_service_; | 24 contacts::ContactsServicePtr contacts_service_; |
| 26 | 25 |
| 27 DISALLOW_COPY_AND_ASSIGN(ContactAppTest); | 26 DISALLOW_COPY_AND_ASSIGN(ContactAppTest); |
| 28 }; | 27 }; |
| 29 | 28 |
| 30 TEST_F(ContactAppTest, Count) { | 29 TEST_F(ContactAppTest, Count) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 82 |
| 84 contacts_service_->GetPhoto(0, true, [&url](const mojo::String& u) { | 83 contacts_service_->GetPhoto(0, true, [&url](const mojo::String& u) { |
| 85 url = u; | 84 url = u; |
| 86 base::MessageLoop::current()->QuitWhenIdle(); | 85 base::MessageLoop::current()->QuitWhenIdle(); |
| 87 }); | 86 }); |
| 88 { base::RunLoop().Run(); }; | 87 { base::RunLoop().Run(); }; |
| 89 EXPECT_TRUE(url.is_null()); | 88 EXPECT_TRUE(url.is_null()); |
| 90 } | 89 } |
| 91 | 90 |
| 92 } // namespace contacts | 91 } // namespace contacts |
| OLD | NEW |