| 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 |
| 11 #include "mojo/shell/public/cpp/application_impl.h" | 11 #include "mojo/shell/public/cpp/shell.h" |
| 12 #include "mojo/util/capture_util.h" | 12 #include "mojo/util/capture_util.h" |
| 13 #include "sql/mojo/mojo_vfs.h" | 13 #include "sql/mojo/mojo_vfs.h" |
| 14 #include "sql/test/test_helpers.h" | 14 #include "sql/test/test_helpers.h" |
| 15 | 15 |
| 16 using mojo::Capture; | 16 using mojo::Capture; |
| 17 | 17 |
| 18 namespace sql { | 18 namespace sql { |
| 19 | 19 |
| 20 SQLTestBase::SQLTestBase() | 20 SQLTestBase::SQLTestBase() |
| 21 : binding_(this) { | 21 : binding_(this) { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return; | 130 return; |
| 131 | 131 |
| 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 shell()->ConnectToService("mojo:filesystem", &files_); |
| 141 | 141 |
| 142 filesystem::FileError error = filesystem::FileError::FAILED; | 142 filesystem::FileError error = filesystem::FileError::FAILED; |
| 143 filesystem::DirectoryPtr directory; | 143 filesystem::DirectoryPtr directory; |
| 144 files()->OpenFileSystem("temp", GetProxy(&directory), | 144 files()->OpenFileSystem("temp", GetProxy(&directory), |
| 145 binding_.CreateInterfacePtrAndBind(), | 145 binding_.CreateInterfacePtrAndBind(), |
| 146 Capture(&error)); | 146 Capture(&error)); |
| 147 ASSERT_TRUE(files().WaitForIncomingResponse()); | 147 ASSERT_TRUE(files().WaitForIncomingResponse()); |
| 148 ASSERT_EQ(filesystem::FileError::OK, error); | 148 ASSERT_EQ(filesystem::FileError::OK, error); |
| 149 | 149 |
| 150 vfs_.reset(new ScopedMojoFilesystemVFS(std::move(directory))); | 150 vfs_.reset(new ScopedMojoFilesystemVFS(std::move(directory))); |
| 151 ASSERT_TRUE(db_.Open(db_path())); | 151 ASSERT_TRUE(db_.Open(db_path())); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void SQLTestBase::TearDown() { | 154 void SQLTestBase::TearDown() { |
| 155 db_.Close(); | 155 db_.Close(); |
| 156 vfs_.reset(); | 156 vfs_.reset(); |
| 157 | 157 |
| 158 ApplicationTestBase::TearDown(); | 158 ApplicationTestBase::TearDown(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void SQLTestBase::OnFileSystemShutdown() { | 161 void SQLTestBase::OnFileSystemShutdown() { |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace sql | 164 } // namespace sql |
| OLD | NEW |