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 <stdint.h> | 5 #include <stdint.h> |
6 | |
7 #include <memory> | 6 #include <memory> |
| 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "components/filesystem/public/interfaces/file_system.mojom.h" | 10 #include "components/filesystem/public/interfaces/file_system.mojom.h" |
11 #include "mojo/application/public/cpp/application_impl.h" | 11 #include "mojo/application/public/cpp/application_impl.h" |
12 #include "mojo/application/public/cpp/application_test_base.h" | 12 #include "mojo/application/public/cpp/application_test_base.h" |
13 #include "mojo/util/capture_util.h" | 13 #include "mojo/util/capture_util.h" |
14 #include "sql/mojo/mojo_vfs.h" | 14 #include "sql/mojo/mojo_vfs.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "third_party/sqlite/sqlite3.h" | 16 #include "third_party/sqlite/sqlite3.h" |
17 | 17 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void SetUp() override { | 53 void SetUp() override { |
54 mojo::test::ApplicationTestBase::SetUp(); | 54 mojo::test::ApplicationTestBase::SetUp(); |
55 | 55 |
56 application_impl()->ConnectToService("mojo:filesystem", &files_); | 56 application_impl()->ConnectToService("mojo:filesystem", &files_); |
57 | 57 |
58 filesystem::FileSystemClientPtr client; | 58 filesystem::FileSystemClientPtr client; |
59 binding_.Bind(GetProxy(&client)); | 59 binding_.Bind(GetProxy(&client)); |
60 | 60 |
61 filesystem::FileError error = filesystem::FILE_ERROR_FAILED; | 61 filesystem::FileError error = filesystem::FILE_ERROR_FAILED; |
62 filesystem::DirectoryPtr directory; | 62 filesystem::DirectoryPtr directory; |
63 files_->OpenFileSystem("temp", GetProxy(&directory), client.Pass(), | 63 files_->OpenFileSystem("temp", GetProxy(&directory), std::move(client), |
64 mojo::Capture(&error)); | 64 mojo::Capture(&error)); |
65 ASSERT_TRUE(files_.WaitForIncomingResponse()); | 65 ASSERT_TRUE(files_.WaitForIncomingResponse()); |
66 ASSERT_EQ(filesystem::FILE_ERROR_OK, error); | 66 ASSERT_EQ(filesystem::FILE_ERROR_OK, error); |
67 | 67 |
68 vfs_.reset(new ScopedMojoFilesystemVFS(directory.Pass())); | 68 vfs_.reset(new ScopedMojoFilesystemVFS(std::move(directory))); |
69 } | 69 } |
70 | 70 |
71 void TearDown() override { | 71 void TearDown() override { |
72 vfs_.reset(); | 72 vfs_.reset(); |
73 mojo::test::ApplicationTestBase::TearDown(); | 73 mojo::test::ApplicationTestBase::TearDown(); |
74 } | 74 } |
75 | 75 |
76 void OnFileSystemShutdown() override { | 76 void OnFileSystemShutdown() override { |
77 } | 77 } |
78 | 78 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 EXPECT_EQ(SQLITE_OK, rc); | 333 EXPECT_EQ(SQLITE_OK, rc); |
334 | 334 |
335 rc = file->pMethods->xFileSize(file.get(), &size); | 335 rc = file->pMethods->xFileSize(file.get(), &size); |
336 EXPECT_EQ(SQLITE_OK, rc); | 336 EXPECT_EQ(SQLITE_OK, rc); |
337 EXPECT_EQ(kCharsToThree, size); | 337 EXPECT_EQ(kCharsToThree, size); |
338 | 338 |
339 file->pMethods->xClose(file.get()); | 339 file->pMethods->xClose(file.get()); |
340 } | 340 } |
341 | 341 |
342 } // namespace sql | 342 } // namespace sql |
OLD | NEW |