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_Dev; | 12 struct PPB_FileIOTrusted_Dev; |
13 | 13 |
14 namespace pp { | 14 namespace pp { |
15 class FileIO_Dev; | 15 class FileIO_Dev; |
16 class URLLoader; | 16 class URLLoader; |
17 class URLRequestInfo; | 17 class URLRequestInfo; |
18 } | 18 } |
19 | 19 |
20 class TestURLLoader : public TestCase { | 20 class TestURLLoader : public TestCase { |
21 public: | 21 public: |
22 explicit TestURLLoader(TestingInstance* instance); | 22 explicit TestURLLoader(TestingInstance* instance); |
23 | 23 |
24 // TestCase implementation. | 24 // TestCase implementation. |
25 virtual bool Init(); | 25 virtual bool Init(); |
26 virtual void RunTest(); | 26 virtual void RunTest(); |
27 | 27 |
28 private: | 28 private: |
29 std::string ReadEntireFile(pp::FileIO_Dev* file_io, std::string* data); | 29 std::string ReadEntireFile(pp::FileIO_Dev* file_io, std::string* data, |
| 30 bool force_async); |
30 std::string ReadEntireResponseBody(pp::URLLoader* loader, | 31 std::string ReadEntireResponseBody(pp::URLLoader* loader, |
31 std::string* body); | 32 std::string* body); |
32 std::string LoadAndCompareBody(const pp::URLRequestInfo& request, | 33 std::string LoadAndCompareBody(const pp::URLRequestInfo& request, |
33 const std::string& expected_body); | 34 const std::string& expected_body); |
| 35 std::string StreamToFile(bool force_async); |
34 | 36 |
35 std::string TestBasicGET(); | 37 std::string TestBasicGET(); |
36 std::string TestBasicPOST(); | 38 std::string TestBasicPOST(); |
37 std::string TestCompoundBodyPOST(); | 39 std::string TestCompoundBodyPOST(); |
38 std::string TestEmptyDataPOST(); | 40 std::string TestEmptyDataPOST(); |
39 std::string TestBinaryDataPOST(); | 41 std::string TestBinaryDataPOST(); |
40 std::string TestCustomRequestHeader(); | 42 std::string TestCustomRequestHeader(); |
41 std::string TestIgnoresBogusContentLength(); | 43 std::string TestIgnoresBogusContentLength(); |
42 std::string TestStreamToFile(); | 44 std::string TestStreamToFile(); |
| 45 std::string TestStreamToFileForceAsync(); |
43 std::string TestSameOriginRestriction(); | 46 std::string TestSameOriginRestriction(); |
44 std::string TestCrossOriginRequest(); | 47 std::string TestCrossOriginRequest(); |
45 std::string TestAuditURLRedirect(); | 48 std::string TestAuditURLRedirect(); |
46 std::string TestAbortCalls(); | 49 std::string TestAbortCalls(); |
47 | 50 |
48 const PPB_FileIOTrusted_Dev* file_io_trusted_interface_; | 51 const PPB_FileIOTrusted_Dev* file_io_trusted_interface_; |
49 }; | 52 }; |
50 | 53 |
51 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ | 54 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ |
OLD | NEW |