| 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 struct PPB_URLLoaderTrusted; | 13 struct PPB_URLLoaderTrusted; |
| 14 | 14 |
| 15 namespace pp { | 15 namespace pp { |
| 16 class FileIO; | 16 class FileIO; |
| 17 class FileRef; | 17 class FileRef; |
| 18 class FileSystem; | 18 class FileSystem; |
| 19 class URLLoader; | 19 class URLLoader; |
| 20 class URLRequestInfo; | 20 class URLRequestInfo; |
| 21 } | 21 } |
| 22 | 22 |
| 23 class TestURLLoader : public TestCase { | 23 class TestURLLoader : public TestCase { |
| 24 public: | 24 public: |
| 25 explicit TestURLLoader(TestingInstance* instance); | 25 explicit TestURLLoader(TestingInstance* instance); |
| 26 | 26 |
| 27 // TestCase implementation. | 27 // TestCase implementation. |
| 28 virtual bool Init(); | 28 virtual bool Init(); |
| 29 virtual void RunTest(); | 29 virtual void RunTests(const std::string& filter); |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 std::string ReadEntireFile(pp::FileIO* file_io, std::string* data); | 32 std::string ReadEntireFile(pp::FileIO* file_io, std::string* data); |
| 33 std::string ReadEntireResponseBody(pp::URLLoader* loader, | 33 std::string ReadEntireResponseBody(pp::URLLoader* loader, |
| 34 std::string* body); | 34 std::string* body); |
| 35 std::string LoadAndCompareBody(const pp::URLRequestInfo& request, | 35 std::string LoadAndCompareBody(const pp::URLRequestInfo& request, |
| 36 const std::string& expected_body); | 36 const std::string& expected_body); |
| 37 int32_t OpenFileSystem(pp::FileSystem* file_system, std::string* message); | 37 int32_t OpenFileSystem(pp::FileSystem* file_system, std::string* message); |
| 38 int32_t PrepareFileForPost(const pp::FileRef& file_ref, | 38 int32_t PrepareFileForPost(const pp::FileRef& file_ref, |
| 39 const std::string& data, | 39 const std::string& data, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 67 std::string TestCustomContentTransferEncoding(); | 67 std::string TestCustomContentTransferEncoding(); |
| 68 std::string TestAuditURLRedirect(); | 68 std::string TestAuditURLRedirect(); |
| 69 std::string TestAbortCalls(); | 69 std::string TestAbortCalls(); |
| 70 std::string TestUntendedLoad(); | 70 std::string TestUntendedLoad(); |
| 71 | 71 |
| 72 const PPB_FileIOTrusted* file_io_trusted_interface_; | 72 const PPB_FileIOTrusted* file_io_trusted_interface_; |
| 73 const PPB_URLLoaderTrusted* url_loader_trusted_interface_; | 73 const PPB_URLLoaderTrusted* url_loader_trusted_interface_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ | 76 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ |
| OLD | NEW |