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

Unified Diff: native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_util.h

Issue 2156503002: [NaCl SDK] Expose Google Drive to nacl_io. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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: native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_util.h
diff --git a/native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_util.h b/native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..dfe7f2e8b7b31676ded1c00c67a390431dcf5d78
--- /dev/null
+++ b/native_client_sdk/src/tests/nacl_io_test/fake_ppapi/fake_util.h
@@ -0,0 +1,73 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef LIBRARIES_NACL_IO_TEST_FAKE_UTIL_H_
+#define LIBRARIES_NACL_IO_TEST_FAKE_UTIL_H_
+
+#include <string>
+
+#include <ppapi/c/pp_completion_callback.h>
+
+#include "fake_ppapi/fake_filesystem.h"
+#include "fake_ppapi/fake_resource_manager.h"
+
+const int32_t STATUSCODE_OK = 200;
+const int32_t STATUSCODE_NO_CONTENT = 204;
+const int32_t STATUSCODE_PARTIAL_CONTENT = 206;
+const int32_t STATUSCODE_BAD_REQUEST = 400;
+const int32_t STATUSCODE_UNAUTHORIZED = 401;
+const int32_t STATUSCODE_FORBIDDEN = 403;
+const int32_t STATUSCODE_NOT_FOUND = 404;
+const int32_t STATUSCODE_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
+const int32_t STATUSCODE_INTERNAL_SERVER_ERROR = 500;
+const int32_t STATUSCODE_NOT_IMPLEMENTED = 501;
+
+class FakeFileSystemResource : public FakeResource {
+ public:
+ FakeFileSystemResource() : filesystem(NULL), opened(false) {}
+ ~FakeFileSystemResource() { delete filesystem; }
+ static const char* classname() { return "FakeFileSystemResource"; }
+
+ FakeFilesystem* filesystem; // Owned.
+ bool opened;
+};
+
+class FakeFileRefResource : public FakeResource {
+ public:
+ FakeFileRefResource() : filesystem(NULL) {}
+ static const char* classname() { return "FakeFileRefResource"; }
+
+ FakeFilesystem* filesystem; // Weak reference.
+ FakeFilesystem::Path path;
+ std::string contents;
+};
+
+class FakeURLRequestInfoResource : public FakeResource {
+ public:
+ FakeURLRequestInfoResource() {}
+ static const char* classname() { return "FakeURLRequestInfoResource"; }
+
+ std::string url;
+ std::string method;
+ std::string headers;
+ std::string body;
+};
+
+class FakeURLResponseInfoResource : public FakeResource {
+ public:
+ FakeURLResponseInfoResource() : status_code(0) {}
+ static const char* classname() { return "FakeURLResponseInfoResource"; }
+
+ int status_code;
+ std::string url;
+ std::string headers;
+ std::string body;
+};
+
+int32_t RunCompletionCallback(PP_CompletionCallback* callback, int32_t result);
+bool GetHeaderValue(const std::string& headers,
+ const std::string& key,
+ std::string* out_value);
+
+#endif // LIBRARIES_NACL_IO_TEST_FAKE_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698