| 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 #ifndef PAPPI_TESTS_TEST_URL_LOADER_H_ | 5 #ifndef PAPPI_TESTS_TEST_URL_LOADER_H_ |
| 6 #define PAPPI_TESTS_TEST_URL_LOADER_H_ | 6 #define PAPPI_TESTS_TEST_URL_LOADER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ppapi/tests/test_case.h" | 10 #include "ppapi/tests/test_case.h" |
| 11 | 11 |
| 12 struct PPB_FileIOTrusted; | 12 struct PPB_FileIOTrusted; |
| 13 | 13 |
| 14 namespace pp { | 14 namespace pp { |
| 15 class FileIO; | 15 class FileIO; |
| 16 class FileRef; |
| 17 class FileSystem; |
| 16 class URLLoader; | 18 class URLLoader; |
| 17 class URLRequestInfo; | 19 class URLRequestInfo; |
| 18 } | 20 } |
| 19 | 21 |
| 20 class TestURLLoader : public TestCase { | 22 class TestURLLoader : public TestCase { |
| 21 public: | 23 public: |
| 22 explicit TestURLLoader(TestingInstance* instance); | 24 explicit TestURLLoader(TestingInstance* instance); |
| 23 | 25 |
| 24 // TestCase implementation. | 26 // TestCase implementation. |
| 25 virtual bool Init(); | 27 virtual bool Init(); |
| 26 virtual void RunTest(); | 28 virtual void RunTest(); |
| 27 | 29 |
| 28 private: | 30 private: |
| 29 std::string ReadEntireFile(pp::FileIO* file_io, std::string* data); | 31 std::string ReadEntireFile(pp::FileIO* file_io, std::string* data); |
| 30 std::string ReadEntireResponseBody(pp::URLLoader* loader, | 32 std::string ReadEntireResponseBody(pp::URLLoader* loader, |
| 31 std::string* body); | 33 std::string* body); |
| 32 std::string LoadAndCompareBody(const pp::URLRequestInfo& request, | 34 std::string LoadAndCompareBody(const pp::URLRequestInfo& request, |
| 33 const std::string& expected_body); | 35 const std::string& expected_body); |
| 36 int32_t OpenFileSystem(pp::FileSystem* file_system, std::string* message); |
| 37 int32_t PrepareFileForPost(const pp::FileRef& file_ref, |
| 38 const std::string& data, |
| 39 std::string* message); |
| 34 | 40 |
| 35 std::string TestBasicGET(); | 41 std::string TestBasicGET(); |
| 36 std::string TestBasicPOST(); | 42 std::string TestBasicPOST(); |
| 43 std::string TestBasicFilePOST(); |
| 44 std::string TestBasicFileRangePOST(); |
| 37 std::string TestCompoundBodyPOST(); | 45 std::string TestCompoundBodyPOST(); |
| 38 std::string TestEmptyDataPOST(); | 46 std::string TestEmptyDataPOST(); |
| 39 std::string TestBinaryDataPOST(); | 47 std::string TestBinaryDataPOST(); |
| 40 std::string TestCustomRequestHeader(); | 48 std::string TestCustomRequestHeader(); |
| 41 std::string TestIgnoresBogusContentLength(); | 49 std::string TestIgnoresBogusContentLength(); |
| 42 std::string TestStreamToFile(); | 50 std::string TestStreamToFile(); |
| 43 std::string TestSameOriginRestriction(); | 51 std::string TestSameOriginRestriction(); |
| 44 std::string TestJavascriptURLRestriction(); | 52 std::string TestJavascriptURLRestriction(); |
| 45 std::string TestCrossOriginRequest(); | 53 std::string TestCrossOriginRequest(); |
| 46 std::string TestAuditURLRedirect(); | 54 std::string TestAuditURLRedirect(); |
| 47 std::string TestAbortCalls(); | 55 std::string TestAbortCalls(); |
| 48 std::string TestUntendedLoad(); | 56 std::string TestUntendedLoad(); |
| 49 | 57 |
| 50 const PPB_FileIOTrusted* file_io_trusted_interface_; | 58 const PPB_FileIOTrusted* file_io_trusted_interface_; |
| 51 }; | 59 }; |
| 52 | 60 |
| 53 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ | 61 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ |
| OLD | NEW |