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 "files/c/tests/mojio_impl_test_base.h" | 5 #include "files/c/tests/mojio_impl_test_base.h" |
6 | 6 |
7 #include "files/interfaces/files.mojom-sync.h" | 7 #include "files/interfaces/files.mojom-sync.h" |
8 #include "files/interfaces/files.mojom.h" | 8 #include "files/interfaces/files.mojom.h" |
9 #include "mojo/public/cpp/application/application_impl.h" | 9 #include "mojo/public/cpp/application/application_impl.h" |
10 #include "mojo/public/cpp/bindings/interface_request.h" | 10 #include "mojo/public/cpp/bindings/interface_request.h" |
11 #include "mojo/public/cpp/bindings/synchronous_interface_ptr.h" | 11 #include "mojo/public/cpp/bindings/synchronous_interface_ptr.h" |
12 #include "mojo/public/cpp/environment/logging.h" | 12 #include "mojo/public/cpp/environment/logging.h" |
13 | 13 |
14 using mojo::SynchronousInterfacePtr; | 14 using mojo::SynchronousInterfacePtr; |
15 | 15 |
16 namespace mojio { | 16 namespace mojio { |
17 namespace test { | 17 namespace test { |
18 | 18 |
19 MojioImplTestBase::MojioImplTestBase() { | 19 MojioImplTestBase::MojioImplTestBase() { |
20 } | 20 } |
21 | 21 |
22 MojioImplTestBase::~MojioImplTestBase() { | 22 MojioImplTestBase::~MojioImplTestBase() { |
23 } | 23 } |
24 | 24 |
25 void MojioImplTestBase::SetUp() { | 25 void MojioImplTestBase::SetUp() { |
26 mojo::test::ApplicationTestBase::SetUp(); | 26 mojo::test::ApplicationTestBase::SetUp(); |
27 | 27 |
28 mojo::files::FilesPtr files_async; | 28 mojo::files::FilesPtr files_async; |
29 // TODO(vtl): Fix |ConnectToService()|, etc. | 29 // TODO(vtl): Fix this. |
30 application_impl()->ConnectToService("mojo:files", &files_async); | 30 application_impl()->ConnectToServiceDeprecated("mojo:files", &files_async); |
31 auto files = SynchronousInterfacePtr<mojo::files::Files>::Create( | 31 auto files = SynchronousInterfacePtr<mojo::files::Files>::Create( |
32 files_async.PassInterfaceHandle()); | 32 files_async.PassInterfaceHandle()); |
33 | 33 |
34 mojo::files::Error error = mojo::files::Error::INTERNAL; | 34 mojo::files::Error error = mojo::files::Error::INTERNAL; |
35 MOJO_CHECK( | 35 MOJO_CHECK( |
36 files->OpenFileSystem(nullptr, mojo::GetProxy(&directory_), &error)); | 36 files->OpenFileSystem(nullptr, mojo::GetProxy(&directory_), &error)); |
37 MOJO_CHECK(error == mojo::files::Error::OK); | 37 MOJO_CHECK(error == mojo::files::Error::OK); |
38 } | 38 } |
39 | 39 |
40 } // namespace test | 40 } // namespace test |
41 } // namespace mojio | 41 } // namespace mojio |
OLD | NEW |