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

Unified Diff: sql/mojo/sql_test_base.cc

Issue 1527183003: Change mojo enums to be scoped enums in the generated C++ bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-binding-equals
Patch Set: rebase Created 4 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sql/mojo/mojo_vfs.cc ('k') | sql/mojo/vfs_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/mojo/sql_test_base.cc
diff --git a/sql/mojo/sql_test_base.cc b/sql/mojo/sql_test_base.cc
index 72aaa64f964f5196b3de6d40eda85d1bc75bca81..a5e061d7b325d6970cfb480fe278833fabcc8cc6 100644
--- a/sql/mojo/sql_test_base.cc
+++ b/sql/mojo/sql_test_base.cc
@@ -38,11 +38,11 @@ bool SQLTestBase::Reopen() {
}
bool SQLTestBase::GetPathExists(const base::FilePath& path) {
- filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
+ filesystem::FileError error = filesystem::FileError::FAILED;
bool exists = false;
vfs_->GetDirectory()->Exists(path.AsUTF8Unsafe(), Capture(&error, &exists));
vfs_->GetDirectory().WaitForIncomingResponse();
- if (error != filesystem::FILE_ERROR_OK)
+ if (error != filesystem::FileError::OK)
return false;
return exists;
}
@@ -53,7 +53,7 @@ bool SQLTestBase::CorruptSizeInHeaderOfDB() {
mojo::Array<uint8_t> header;
- filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
+ filesystem::FileError error = filesystem::FileError::FAILED;
filesystem::FilePtr file_ptr;
vfs_->GetDirectory()->OpenFile(
mojo::String(db_path().AsUTF8Unsafe()), GetProxy(&file_ptr),
@@ -61,29 +61,29 @@ bool SQLTestBase::CorruptSizeInHeaderOfDB() {
filesystem::kFlagOpenAlways,
Capture(&error));
vfs_->GetDirectory().WaitForIncomingResponse();
- if (error != filesystem::FILE_ERROR_OK)
+ if (error != filesystem::FileError::OK)
return false;
- file_ptr->Read(kHeaderSize, 0, filesystem::WHENCE_FROM_BEGIN,
+ file_ptr->Read(kHeaderSize, 0, filesystem::Whence::FROM_BEGIN,
Capture(&error, &header));
file_ptr.WaitForIncomingResponse();
- if (error != filesystem::FILE_ERROR_OK)
+ if (error != filesystem::FileError::OK)
return false;
filesystem::FileInformationPtr info;
file_ptr->Stat(Capture(&error, &info));
file_ptr.WaitForIncomingResponse();
- if (error != filesystem::FILE_ERROR_OK)
+ if (error != filesystem::FileError::OK)
return false;
int64_t db_size = info->size;
test::CorruptSizeInHeaderMemory(&header.front(), db_size);
uint32_t num_bytes_written = 0;
- file_ptr->Write(std::move(header), 0, filesystem::WHENCE_FROM_BEGIN,
+ file_ptr->Write(std::move(header), 0, filesystem::Whence::FROM_BEGIN,
Capture(&error, &num_bytes_written));
file_ptr.WaitForIncomingResponse();
- if (error != filesystem::FILE_ERROR_OK)
+ if (error != filesystem::FileError::OK)
return false;
if (num_bytes_written != kHeaderSize)
return false;
@@ -98,14 +98,14 @@ void SQLTestBase::WriteJunkToDatabase(WriteJunkType type) {
else
flags = filesystem::kFlagWrite | filesystem::kFlagOpen;
- filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
+ filesystem::FileError error = filesystem::FileError::FAILED;
filesystem::FilePtr file_ptr;
vfs_->GetDirectory()->OpenFile(
mojo::String(db_path().AsUTF8Unsafe()), GetProxy(&file_ptr),
flags,
Capture(&error));
vfs_->GetDirectory().WaitForIncomingResponse();
- if (error != filesystem::FILE_ERROR_OK)
+ if (error != filesystem::FileError::OK)
return;
const char* kJunk = "Now is the winter of our discontent.";
@@ -113,25 +113,25 @@ void SQLTestBase::WriteJunkToDatabase(WriteJunkType type) {
memcpy(&data.front(), kJunk, strlen(kJunk));
uint32_t num_bytes_written = 0;
- file_ptr->Write(std::move(data), 0, filesystem::WHENCE_FROM_BEGIN,
+ file_ptr->Write(std::move(data), 0, filesystem::Whence::FROM_BEGIN,
Capture(&error, &num_bytes_written));
file_ptr.WaitForIncomingResponse();
}
void SQLTestBase::TruncateDatabase() {
- filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
+ filesystem::FileError error = filesystem::FileError::FAILED;
filesystem::FilePtr file_ptr;
vfs_->GetDirectory()->OpenFile(
mojo::String(db_path().AsUTF8Unsafe()), GetProxy(&file_ptr),
filesystem::kFlagWrite | filesystem::kFlagOpen,
Capture(&error));
vfs_->GetDirectory().WaitForIncomingResponse();
- if (error != filesystem::FILE_ERROR_OK)
+ if (error != filesystem::FileError::OK)
return;
file_ptr->Truncate(0, Capture(&error));
file_ptr.WaitForIncomingResponse();
- ASSERT_EQ(filesystem::FILE_ERROR_OK, error);
+ ASSERT_EQ(filesystem::FileError::OK, error);
}
void SQLTestBase::SetUp() {
@@ -142,12 +142,12 @@ void SQLTestBase::SetUp() {
filesystem::FileSystemClientPtr client;
binding_.Bind(GetProxy(&client));
- filesystem::FileError error = filesystem::FILE_ERROR_FAILED;
+ filesystem::FileError error = filesystem::FileError::FAILED;
filesystem::DirectoryPtr directory;
files()->OpenFileSystem("temp", GetProxy(&directory), std::move(client),
Capture(&error));
ASSERT_TRUE(files().WaitForIncomingResponse());
- ASSERT_EQ(filesystem::FILE_ERROR_OK, error);
+ ASSERT_EQ(filesystem::FileError::OK, error);
vfs_.reset(new ScopedMojoFilesystemVFS(std::move(directory)));
ASSERT_TRUE(db_.Open(db_path()));
« no previous file with comments | « sql/mojo/mojo_vfs.cc ('k') | sql/mojo/vfs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698