OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "ppapi/tests/test_file_ref.h" | 5 #include "ppapi/tests/test_file_ref.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/dev/ppb_file_io_dev.h" | 10 #include "ppapi/c/dev/ppb_file_io_dev.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 std::string ReportMismatch(const std::string& method_name, | 59 std::string ReportMismatch(const std::string& method_name, |
60 const std::string& returned_result, | 60 const std::string& returned_result, |
61 const std::string& expected_result) { | 61 const std::string& expected_result) { |
62 return method_name + " returned '" + returned_result + "'; '" + | 62 return method_name + " returned '" + returned_result + "'; '" + |
63 expected_result + "' expected."; | 63 expected_result + "' expected."; |
64 } | 64 } |
65 | 65 |
66 std::string ReportError(const char* method, int32_t error) { | 66 std::string ReportError(const char* method, int32_t error) { |
67 char error_as_string[12]; | 67 char error_as_string[12]; |
68 sprintf(error_as_string, "%d", error); | 68 sprintf(error_as_string, "%d", static_cast<int>(error)); |
69 std::string result = method + std::string(" failed with error: ") + | 69 std::string result = method + std::string(" failed with error: ") + |
70 error_as_string; | 70 error_as_string; |
71 if (error == PP_ERROR_NOSPACE) | 71 if (error == PP_ERROR_NOSPACE) |
72 result += ". Did you run the test with --unlimited-quota-for-files?"; | 72 result += ". Did you run the test with --unlimited-quota-for-files?"; |
73 return result; | 73 return result; |
74 } | 74 } |
75 | 75 |
76 } // namespace | 76 } // namespace |
77 | 77 |
78 bool TestFileRef::Init() { | 78 bool TestFileRef::Init() { |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 | 493 |
494 pp::FileRef_Dev target_nested_dir_ref(file_system, "/dir_rename_1"); | 494 pp::FileRef_Dev target_nested_dir_ref(file_system, "/dir_rename_1"); |
495 rv = nested_dir_ref.Rename(target_nested_dir_ref, callback); | 495 rv = nested_dir_ref.Rename(target_nested_dir_ref, callback); |
496 if (rv == PP_ERROR_WOULDBLOCK) | 496 if (rv == PP_ERROR_WOULDBLOCK) |
497 rv = callback.WaitForResult(); | 497 rv = callback.WaitForResult(); |
498 if (rv != PP_ERROR_FAILED) | 498 if (rv != PP_ERROR_FAILED) |
499 return ReportError("FileSystem::Rename", rv); | 499 return ReportError("FileSystem::Rename", rv); |
500 | 500 |
501 return ""; | 501 return ""; |
502 } | 502 } |
OLD | NEW |