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

Side by Side Diff: sql/mojo/vfs_unittest.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 | « sql/mojo/sql_test_base.cc ('k') | ui/views/mus/window_manager_connection.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 <memory> 5 #include <memory>
6 6
7 #include "components/filesystem/public/interfaces/file_system.mojom.h" 7 #include "components/filesystem/public/interfaces/file_system.mojom.h"
8 #include "mojo/application/public/cpp/application_impl.h" 8 #include "mojo/application/public/cpp/application_impl.h"
9 #include "mojo/application/public/cpp/application_test_base.h" 9 #include "mojo/application/public/cpp/application_test_base.h"
10 #include "mojo/util/capture_util.h" 10 #include "mojo/util/capture_util.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 scoped_ptr<sqlite3_file> MakeFile() { 45 scoped_ptr<sqlite3_file> MakeFile() {
46 return scoped_ptr<sqlite3_file>(reinterpret_cast<sqlite3_file*>( 46 return scoped_ptr<sqlite3_file>(reinterpret_cast<sqlite3_file*>(
47 new uint8_t[vfs()->szOsFile])); 47 new uint8_t[vfs()->szOsFile]));
48 } 48 }
49 49
50 void SetUp() override { 50 void SetUp() override {
51 mojo::test::ApplicationTestBase::SetUp(); 51 mojo::test::ApplicationTestBase::SetUp();
52 52
53 mojo::URLRequestPtr request(mojo::URLRequest::New()); 53 application_impl()->ConnectToService("mojo:filesystem", &files_);
54 request->url = mojo::String::From("mojo:filesystem");
55 application_impl()->ConnectToService(request.Pass(), &files_);
56 54
57 filesystem::FileSystemClientPtr client; 55 filesystem::FileSystemClientPtr client;
58 binding_.Bind(GetProxy(&client)); 56 binding_.Bind(GetProxy(&client));
59 57
60 filesystem::FileError error = filesystem::FILE_ERROR_FAILED; 58 filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
61 filesystem::DirectoryPtr directory; 59 filesystem::DirectoryPtr directory;
62 files_->OpenFileSystem("temp", GetProxy(&directory), client.Pass(), 60 files_->OpenFileSystem("temp", GetProxy(&directory), client.Pass(),
63 mojo::Capture(&error)); 61 mojo::Capture(&error));
64 ASSERT_TRUE(files_.WaitForIncomingResponse()); 62 ASSERT_TRUE(files_.WaitForIncomingResponse());
65 ASSERT_EQ(filesystem::FILE_ERROR_OK, error); 63 ASSERT_EQ(filesystem::FILE_ERROR_OK, error);
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 EXPECT_EQ(SQLITE_OK, rc); 330 EXPECT_EQ(SQLITE_OK, rc);
333 331
334 rc = file->pMethods->xFileSize(file.get(), &size); 332 rc = file->pMethods->xFileSize(file.get(), &size);
335 EXPECT_EQ(SQLITE_OK, rc); 333 EXPECT_EQ(SQLITE_OK, rc);
336 EXPECT_EQ(kCharsToThree, size); 334 EXPECT_EQ(kCharsToThree, size);
337 335
338 file->pMethods->xClose(file.get()); 336 file->pMethods->xClose(file.get());
339 } 337 }
340 338
341 } // namespace sql 339 } // namespace sql
OLDNEW
« no previous file with comments | « sql/mojo/sql_test_base.cc ('k') | ui/views/mus/window_manager_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698