| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_io.h" | 5 #include "ppapi/tests/test_file_io.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ppapi/c/dev/ppb_testing_dev.h" | 10 #include "ppapi/c/dev/ppb_testing_dev.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 return PP_OK; | 105 return PP_OK; |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace | 108 } // namespace |
| 109 | 109 |
| 110 bool TestFileIO::Init() { | 110 bool TestFileIO::Init() { |
| 111 return InitTestingInterface() && EnsureRunningOverHTTP(); | 111 return InitTestingInterface() && EnsureRunningOverHTTP(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void TestFileIO::RunTest() { | 114 void TestFileIO::RunTests(const std::string& filter) { |
| 115 RUN_TEST_FORCEASYNC_AND_NOT(Open); | 115 RUN_TEST_FORCEASYNC_AND_NOT(Open, filter); |
| 116 RUN_TEST_FORCEASYNC_AND_NOT(ReadWriteSetLength); | 116 RUN_TEST_FORCEASYNC_AND_NOT(ReadWriteSetLength, filter); |
| 117 RUN_TEST_FORCEASYNC_AND_NOT(TouchQuery); | 117 RUN_TEST_FORCEASYNC_AND_NOT(TouchQuery, filter); |
| 118 RUN_TEST_FORCEASYNC_AND_NOT(AbortCalls); | 118 RUN_TEST_FORCEASYNC_AND_NOT(AbortCalls, filter); |
| 119 RUN_TEST_FORCEASYNC_AND_NOT(ParallelReads); | 119 RUN_TEST_FORCEASYNC_AND_NOT(ParallelReads, filter); |
| 120 RUN_TEST_FORCEASYNC_AND_NOT(ParallelWrites); | 120 RUN_TEST_FORCEASYNC_AND_NOT(ParallelWrites, filter); |
| 121 RUN_TEST_FORCEASYNC_AND_NOT(NotAllowMixedReadWrite); | 121 RUN_TEST_FORCEASYNC_AND_NOT(NotAllowMixedReadWrite, filter); |
| 122 RUN_TEST_FORCEASYNC_AND_NOT(WillWriteWillSetLength); | 122 RUN_TEST_FORCEASYNC_AND_NOT(WillWriteWillSetLength, filter); |
| 123 | 123 |
| 124 // TODO(viettrungluu): add tests: | 124 // TODO(viettrungluu): add tests: |
| 125 // - that PP_ERROR_PENDING is correctly returned | 125 // - that PP_ERROR_PENDING is correctly returned |
| 126 // - that operations respect the file open modes (flags) | 126 // - that operations respect the file open modes (flags) |
| 127 } | 127 } |
| 128 | 128 |
| 129 std::string TestFileIO::TestOpen() { | 129 std::string TestFileIO::TestOpen() { |
| 130 TestCompletionCallback callback(instance_->pp_instance(), force_async_); | 130 TestCompletionCallback callback(instance_->pp_instance(), force_async_); |
| 131 | 131 |
| 132 pp::FileSystem file_system(instance_, PP_FILESYSTEMTYPE_LOCALTEMPORARY); | 132 pp::FileSystem file_system(instance_, PP_FILESYSTEMTYPE_LOCALTEMPORARY); |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 rv = callback.WaitForResult(); | 1091 rv = callback.WaitForResult(); |
| 1092 if ((invalid_combination && rv == PP_OK) || | 1092 if ((invalid_combination && rv == PP_OK) || |
| 1093 (!invalid_combination && ((rv == PP_OK) != create_if_doesnt_exist))) { | 1093 (!invalid_combination && ((rv == PP_OK) != create_if_doesnt_exist))) { |
| 1094 return ReportOpenError(open_flags); | 1094 return ReportOpenError(open_flags); |
| 1095 } | 1095 } |
| 1096 | 1096 |
| 1097 return std::string(); | 1097 return std::string(); |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 // TODO(viettrungluu): Test Close(). crbug.com/69457 | 1100 // TODO(viettrungluu): Test Close(). crbug.com/69457 |
| OLD | NEW |