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; | 16 class FileRef; |
17 class FileSystem; | 17 class FileSystem; |
18 class URLLoader; | 18 class URLLoader; |
19 class URLRequestInfo; | 19 class URLRequestInfo; |
20 } | 20 } |
21 | 21 |
22 class TestURLLoader : public TestCase { | 22 class TestURLLoader : public TestCase { |
23 public: | 23 public: |
24 explicit TestURLLoader(TestingInstance* instance); | 24 explicit TestURLLoader(TestingInstance* instance); |
25 | 25 |
26 // TestCase implementation. | 26 // TestCase implementation. |
27 virtual bool Init(); | 27 virtual bool Init(); |
28 virtual void RunTest(); | 28 virtual void RunTests(const std::string& filter); |
29 | 29 |
30 private: | 30 private: |
31 std::string ReadEntireFile(pp::FileIO* file_io, std::string* data); | 31 std::string ReadEntireFile(pp::FileIO* file_io, std::string* data); |
32 std::string ReadEntireResponseBody(pp::URLLoader* loader, | 32 std::string ReadEntireResponseBody(pp::URLLoader* loader, |
33 std::string* body); | 33 std::string* body); |
34 std::string LoadAndCompareBody(const pp::URLRequestInfo& request, | 34 std::string LoadAndCompareBody(const pp::URLRequestInfo& request, |
35 const std::string& expected_body); | 35 const std::string& expected_body); |
36 int32_t OpenFileSystem(pp::FileSystem* file_system, std::string* message); | 36 int32_t OpenFileSystem(pp::FileSystem* file_system, std::string* message); |
37 int32_t PrepareFileForPost(const pp::FileRef& file_ref, | 37 int32_t PrepareFileForPost(const pp::FileRef& file_ref, |
38 const std::string& data, | 38 const std::string& data, |
(...skipping 13 matching lines...) Expand all Loading... |
52 std::string TestJavascriptURLRestriction(); | 52 std::string TestJavascriptURLRestriction(); |
53 std::string TestCrossOriginRequest(); | 53 std::string TestCrossOriginRequest(); |
54 std::string TestAuditURLRedirect(); | 54 std::string TestAuditURLRedirect(); |
55 std::string TestAbortCalls(); | 55 std::string TestAbortCalls(); |
56 std::string TestUntendedLoad(); | 56 std::string TestUntendedLoad(); |
57 | 57 |
58 const PPB_FileIOTrusted* file_io_trusted_interface_; | 58 const PPB_FileIOTrusted* file_io_trusted_interface_; |
59 }; | 59 }; |
60 | 60 |
61 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ | 61 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ |
OLD | NEW |