Index: ppapi/tests/test_file_io.h |
diff --git a/ppapi/tests/test_file_io.h b/ppapi/tests/test_file_io.h |
index 0140824443a533df87caf582d7a730cefe17fb31..2d6117f83a343d6cfa9e20df45a5b072183d204a 100644 |
--- a/ppapi/tests/test_file_io.h |
+++ b/ppapi/tests/test_file_io.h |
@@ -9,6 +9,10 @@ |
#include "ppapi/tests/test_case.h" |
+namespace pp { |
+class FileSystem_Dev; |
+} // namespace pp |
+ |
class TestFileIO : public TestCase { |
public: |
explicit TestFileIO(TestingInstance* instance) : TestCase(instance) {} |
@@ -18,10 +22,34 @@ class TestFileIO : public TestCase { |
virtual void RunTest(); |
private: |
+ enum OpenExpectation { |
+ CREATE_IF_DOESNT_EXIST = 1 << 0, |
+ DONT_CREATE_IF_DOESNT_EXIST = 1 << 1, |
+ OPEN_IF_EXISTS = 1 << 2, |
+ DONT_OPEN_IF_EXISTS = 1 << 3, |
+ TRUNCATE_IF_EXISTS = 1 << 4, |
+ DONT_TRUNCATE_IF_EXISTS = 1 << 5, |
+ // All values above are defined in pairs: <some_expectation> and |
+ // DONT_<some_expectation>. |
+ END_OF_OPEN_EXPECATION_PAIRS = DONT_TRUNCATE_IF_EXISTS, |
+ |
+ INVALID_FLAG_COMBINATION = 1 << 6, |
+ }; |
+ |
std::string TestOpen(); |
std::string TestReadWriteSetLength(); |
std::string TestTouchQuery(); |
std::string TestAbortCalls(); |
+ |
+ // Helper method used by TestOpen(). |
+ // |expectations| is a combination of OpenExpectation values. The followings |
+ // are considered as valid input: |
+ // 1) INVALID_FLAG_COMBINATION |
+ // 2) (DONT_)?CREATE_IF_DOESNT_EXIST | (DONT_)?OPEN_IF_EXISTS | |
+ // (DONT_)?TRUNCATE_IF_EXISTS |
+ std::string MatchOpenExpectations(pp::FileSystem_Dev* file_system, |
+ size_t open_flags, |
+ size_t expectations); |
}; |
#endif // PAPPI_TESTS_TEST_FILE_IO_H_ |