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

Unified Diff: ppapi/tests/test_file_io.h

Issue 7038032: Fix PP_FileOpenFlags_Dev handling: (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: . Created 9 years, 7 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 | « content/browser/worker_host/worker_process_host.cc ('k') | ppapi/tests/test_file_io.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « content/browser/worker_host/worker_process_host.cc ('k') | ppapi/tests/test_file_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698