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

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: Make changes according to Darin's suggestions. 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
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..ddf93dcbb5fa0340a4f77ebd2c47b68b862bce2d 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,32 @@ class TestFileIO : public TestCase {
virtual void RunTest();
private:
+ enum OpenExpectation {
+ CREATE_IF_NOT_EXIST = 1 << 0,
+ NOT_CREATE_IF_NOT_EXIST = 1 << 1,
darin (slow to review) 2011/05/23 18:17:42 nit: this reads funny with the two NOTs... also, t
yzshen1 2011/05/23 19:48:06 Done. Thanks! It looks much better this way. :) O
+ OPEN_IF_EXIST = 1 << 2,
+ NOT_OPEN_IF_EXIST = 1 << 3,
+ TRUNCATE_IF_EXIST = 1 << 4,
+ NOT_TRUNCATE_IF_EXIST = 1 << 5,
+ END_OF_PAIR = NOT_TRUNCATE_IF_EXIST,
darin (slow to review) 2011/05/23 18:17:42 nit: i'm having trouble making sense of END_OF_PAI
yzshen1 2011/05/23 19:48:06 INVALID_FLAG_COMBINATION is also one kind of open
+
+ 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) (NOT_)?CREATE_IF_NOT_EXIST | (NOT_)?OPEN_IF_EXIST |
+ // (NOT_)?TRUNCATE_IF_EXIST
+ std::string MatchOpenExpectations(pp::FileSystem_Dev* file_system,
+ size_t open_flags,
+ size_t expectations);
};
#endif // PAPPI_TESTS_TEST_FILE_IO_H_

Powered by Google App Engine
This is Rietveld 408576698