Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: sql/mojo/sql_test_base.cc

Issue 1455833005: Convert ConnectToApplication to take a params class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/shell/capability_filter_test.cc ('k') | sql/mojo/vfs_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "mojo/application/public/cpp/application_impl.h" 7 #include "mojo/application/public/cpp/application_impl.h"
8 #include "mojo/util/capture_util.h" 8 #include "mojo/util/capture_util.h"
9 #include "sql/mojo/mojo_vfs.h" 9 #include "sql/mojo/mojo_vfs.h"
10 #include "sql/test/test_helpers.h" 10 #include "sql/test/test_helpers.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return; 126 return;
127 127
128 file_ptr->Truncate(0, Capture(&error)); 128 file_ptr->Truncate(0, Capture(&error));
129 file_ptr.WaitForIncomingResponse(); 129 file_ptr.WaitForIncomingResponse();
130 ASSERT_EQ(filesystem::FILE_ERROR_OK, error); 130 ASSERT_EQ(filesystem::FILE_ERROR_OK, error);
131 } 131 }
132 132
133 void SQLTestBase::SetUp() { 133 void SQLTestBase::SetUp() {
134 ApplicationTestBase::SetUp(); 134 ApplicationTestBase::SetUp();
135 135
136 mojo::URLRequestPtr request(mojo::URLRequest::New()); 136 application_impl()->ConnectToService("mojo:filesystem", &files_);
137 request->url = mojo::String::From("mojo:filesystem");
138 application_impl()->ConnectToService(request.Pass(), &files_);
139 137
140 filesystem::FileSystemClientPtr client; 138 filesystem::FileSystemClientPtr client;
141 binding_.Bind(GetProxy(&client)); 139 binding_.Bind(GetProxy(&client));
142 140
143 filesystem::FileError error = filesystem::FILE_ERROR_FAILED; 141 filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
144 filesystem::DirectoryPtr directory; 142 filesystem::DirectoryPtr directory;
145 files()->OpenFileSystem("temp", GetProxy(&directory), client.Pass(), 143 files()->OpenFileSystem("temp", GetProxy(&directory), client.Pass(),
146 Capture(&error)); 144 Capture(&error));
147 ASSERT_TRUE(files().WaitForIncomingResponse()); 145 ASSERT_TRUE(files().WaitForIncomingResponse());
148 ASSERT_EQ(filesystem::FILE_ERROR_OK, error); 146 ASSERT_EQ(filesystem::FILE_ERROR_OK, error);
149 147
150 vfs_.reset(new ScopedMojoFilesystemVFS(directory.Pass())); 148 vfs_.reset(new ScopedMojoFilesystemVFS(directory.Pass()));
151 ASSERT_TRUE(db_.Open(db_path())); 149 ASSERT_TRUE(db_.Open(db_path()));
152 } 150 }
153 151
154 void SQLTestBase::TearDown() { 152 void SQLTestBase::TearDown() {
155 db_.Close(); 153 db_.Close();
156 vfs_.reset(); 154 vfs_.reset();
157 155
158 ApplicationTestBase::TearDown(); 156 ApplicationTestBase::TearDown();
159 } 157 }
160 158
161 void SQLTestBase::OnFileSystemShutdown() { 159 void SQLTestBase::OnFileSystemShutdown() {
162 } 160 }
163 161
164 } // namespace sql 162 } // namespace sql
OLDNEW
« no previous file with comments | « mojo/shell/capability_filter_test.cc ('k') | sql/mojo/vfs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698