| 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 "sql/mojo/sql_test_base.h" | 5 #include "sql/mojo/sql_test_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 file_ptr->Truncate(0, Capture(&error)); | 132 file_ptr->Truncate(0, Capture(&error)); |
| 133 file_ptr.WaitForIncomingResponse(); | 133 file_ptr.WaitForIncomingResponse(); |
| 134 ASSERT_EQ(filesystem::FileError::OK, error); | 134 ASSERT_EQ(filesystem::FileError::OK, error); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void SQLTestBase::SetUp() { | 137 void SQLTestBase::SetUp() { |
| 138 ApplicationTestBase::SetUp(); | 138 ApplicationTestBase::SetUp(); |
| 139 | 139 |
| 140 application_impl()->ConnectToService("mojo:filesystem", &files_); | 140 application_impl()->ConnectToService("mojo:filesystem", &files_); |
| 141 | 141 |
| 142 filesystem::FileSystemClientPtr client; | |
| 143 binding_.Bind(GetProxy(&client)); | |
| 144 | |
| 145 filesystem::FileError error = filesystem::FileError::FAILED; | 142 filesystem::FileError error = filesystem::FileError::FAILED; |
| 146 filesystem::DirectoryPtr directory; | 143 filesystem::DirectoryPtr directory; |
| 147 files()->OpenFileSystem("temp", GetProxy(&directory), std::move(client), | 144 files()->OpenFileSystem("temp", GetProxy(&directory), |
| 145 binding_.CreateInterfacePtrAndBind(), |
| 148 Capture(&error)); | 146 Capture(&error)); |
| 149 ASSERT_TRUE(files().WaitForIncomingResponse()); | 147 ASSERT_TRUE(files().WaitForIncomingResponse()); |
| 150 ASSERT_EQ(filesystem::FileError::OK, error); | 148 ASSERT_EQ(filesystem::FileError::OK, error); |
| 151 | 149 |
| 152 vfs_.reset(new ScopedMojoFilesystemVFS(std::move(directory))); | 150 vfs_.reset(new ScopedMojoFilesystemVFS(std::move(directory))); |
| 153 ASSERT_TRUE(db_.Open(db_path())); | 151 ASSERT_TRUE(db_.Open(db_path())); |
| 154 } | 152 } |
| 155 | 153 |
| 156 void SQLTestBase::TearDown() { | 154 void SQLTestBase::TearDown() { |
| 157 db_.Close(); | 155 db_.Close(); |
| 158 vfs_.reset(); | 156 vfs_.reset(); |
| 159 | 157 |
| 160 ApplicationTestBase::TearDown(); | 158 ApplicationTestBase::TearDown(); |
| 161 } | 159 } |
| 162 | 160 |
| 163 void SQLTestBase::OnFileSystemShutdown() { | 161 void SQLTestBase::OnFileSystemShutdown() { |
| 164 } | 162 } |
| 165 | 163 |
| 166 } // namespace sql | 164 } // namespace sql |
| OLD | NEW |