| OLD | NEW |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace crashpad { | 23 namespace crashpad { |
| 24 namespace test { | 24 namespace test { |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 bool FileExistsAtPath(const base::FilePath& path) { | 27 bool FileExistsAtPath(const base::FilePath& path) { |
| 28 #if defined(OS_POSIX) | 28 #if defined(OS_POSIX) |
| 29 struct stat st; | 29 struct stat st; |
| 30 return lstat(path.value().c_str(), &st) == 0; | 30 return lstat(path.value().c_str(), &st) == 0; |
| 31 #elif defined(OS_WIN) | 31 #elif defined(OS_WIN) |
| 32 struct _stat st; | 32 struct _stat st; |
| 33 return _wstat(path.value().c_str(), &st); | 33 return _wstat(path.value().c_str(), &st) == 0; |
| 34 #else | 34 #else |
| 35 #error "Not implemented" | 35 #error "Not implemented" |
| 36 #endif | 36 #endif |
| 37 } | 37 } |
| 38 | 38 |
| 39 void CreateFile(const base::FilePath& path) { | 39 void CreateFile(const base::FilePath& path) { |
| 40 FileHandle handle = LoggingOpenFileForWrite(path, | 40 FileHandle handle = LoggingOpenFileForWrite(path, |
| 41 FileWriteMode::kCreateOrFail, | 41 FileWriteMode::kCreateOrFail, |
| 42 FilePermissions::kWorldReadable); | 42 FilePermissions::kWorldReadable); |
| 43 #if defined(OS_POSIX) | 43 #if defined(OS_POSIX) |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 db()->GetReportForUploading(report.uuid, &upload_report_2)); | 430 db()->GetReportForUploading(report.uuid, &upload_report_2)); |
| 431 EXPECT_FALSE(upload_report_2); | 431 EXPECT_FALSE(upload_report_2); |
| 432 | 432 |
| 433 EXPECT_EQ(CrashReportDatabase::kNoError, | 433 EXPECT_EQ(CrashReportDatabase::kNoError, |
| 434 db()->RecordUploadAttempt(upload_report, true, "")); | 434 db()->RecordUploadAttempt(upload_report, true, "")); |
| 435 } | 435 } |
| 436 | 436 |
| 437 } // namespace | 437 } // namespace |
| 438 } // namespace test | 438 } // namespace test |
| 439 } // namespace crashpad | 439 } // namespace crashpad |
| OLD | NEW |