OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 namespace pp { | 12 namespace pp { |
13 class FileIO_Dev; | 13 class FileIO_Dev; |
14 class URLLoader_Dev; | 14 class URLLoader; |
15 class URLRequestInfo_Dev; | 15 class URLRequestInfo; |
16 } | 16 } |
17 | 17 |
18 class TestURLLoader : public TestCase { | 18 class TestURLLoader : public TestCase { |
19 public: | 19 public: |
20 explicit TestURLLoader(TestingInstance* instance) : TestCase(instance) {} | 20 explicit TestURLLoader(TestingInstance* instance) : TestCase(instance) {} |
21 | 21 |
22 // TestCase implementation. | 22 // TestCase implementation. |
23 virtual bool Init(); | 23 virtual bool Init(); |
24 virtual void RunTest(); | 24 virtual void RunTest(); |
25 | 25 |
26 private: | 26 private: |
27 std::string ReadEntireFile(pp::FileIO_Dev* file_io, std::string* data); | 27 std::string ReadEntireFile(pp::FileIO_Dev* file_io, std::string* data); |
28 std::string ReadEntireResponseBody(pp::URLLoader_Dev* loader, | 28 std::string ReadEntireResponseBody(pp::URLLoader* loader, |
29 std::string* body); | 29 std::string* body); |
30 std::string LoadAndCompareBody(const pp::URLRequestInfo_Dev& request, | 30 std::string LoadAndCompareBody(const pp::URLRequestInfo& request, |
31 const std::string& expected_body); | 31 const std::string& expected_body); |
32 | 32 |
33 std::string TestBasicGET(); | 33 std::string TestBasicGET(); |
34 std::string TestBasicPOST(); | 34 std::string TestBasicPOST(); |
35 std::string TestCompoundBodyPOST(); | 35 std::string TestCompoundBodyPOST(); |
36 std::string TestEmptyDataPOST(); | 36 std::string TestEmptyDataPOST(); |
37 std::string TestBinaryDataPOST(); | 37 std::string TestBinaryDataPOST(); |
38 std::string TestCustomRequestHeader(); | 38 std::string TestCustomRequestHeader(); |
39 std::string TestIgnoresBogusContentLength(); | 39 std::string TestIgnoresBogusContentLength(); |
40 std::string TestStreamToFile(); | 40 std::string TestStreamToFile(); |
41 std::string TestSameOriginRestriction(); | 41 std::string TestSameOriginRestriction(); |
42 std::string TestAuditURLRedirect(); | 42 std::string TestAuditURLRedirect(); |
43 }; | 43 }; |
44 | 44 |
45 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ | 45 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ |
OLD | NEW |