Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1581)

Side by Side Diff: ppapi/tests/test_url_loader.h

Issue 11417145: Provide a safer URLLoader ReadResponseBody API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/proxy/ppb_url_loader_proxy.cc ('k') | ppapi/tests/test_url_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/c/trusted/ppb_file_io_trusted.h" 10 #include "ppapi/c/trusted/ppb_file_io_trusted.h"
(...skipping 13 matching lines...) Expand all
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 RunTests(const std::string& filter); 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 ReadEntireResponseBodyToArray(pp::URLLoader* loader,
35 std::string* body);
34 std::string LoadAndCompareBody(const pp::URLRequestInfo& request, 36 std::string LoadAndCompareBody(const pp::URLRequestInfo& request,
35 const std::string& expected_body); 37 const std::string& expected_body);
38 std::string LoadAndCompareBody_ToArray(const pp::URLRequestInfo& request,
39 const std::string& expected_body);
36 int32_t OpenFileSystem(pp::FileSystem* file_system, std::string* message); 40 int32_t OpenFileSystem(pp::FileSystem* file_system, std::string* message);
37 int32_t PrepareFileForPost(const pp::FileRef& file_ref, 41 int32_t PrepareFileForPost(const pp::FileRef& file_ref,
38 const std::string& data, 42 const std::string& data,
39 std::string* message); 43 std::string* message);
40 std::string GetReachableAbsoluteURL(const std::string& file_name); 44 std::string GetReachableAbsoluteURL(const std::string& file_name);
41 std::string GetReachableCrossOriginURL(const std::string& file_name); 45 std::string GetReachableCrossOriginURL(const std::string& file_name);
42 int32_t OpenUntrusted(const pp::URLRequestInfo& request); 46 int32_t OpenUntrusted(const pp::URLRequestInfo& request);
43 int32_t OpenTrusted(const pp::URLRequestInfo& request); 47 int32_t OpenTrusted(const pp::URLRequestInfo& request);
44 int32_t OpenUntrusted(const std::string& method, 48 int32_t OpenUntrusted(const std::string& method,
45 const std::string& header); 49 const std::string& header);
46 int32_t OpenTrusted(const std::string& method, 50 int32_t OpenTrusted(const std::string& method,
47 const std::string& header); 51 const std::string& header);
48 int32_t Open(const pp::URLRequestInfo& request, 52 int32_t Open(const pp::URLRequestInfo& request,
49 bool with_universal_access); 53 bool with_universal_access);
50 int32_t OpenWithPrefetchBufferThreshold(int32_t lower, int32_t upper); 54 int32_t OpenWithPrefetchBufferThreshold(int32_t lower, int32_t upper);
51 55
52 std::string TestBasicGET(); 56 std::string TestBasicGET();
57 std::string TestBasicGET_ToArray();
53 std::string TestBasicPOST(); 58 std::string TestBasicPOST();
54 std::string TestBasicFilePOST(); 59 std::string TestBasicFilePOST();
55 std::string TestBasicFileRangePOST(); 60 std::string TestBasicFileRangePOST();
56 std::string TestCompoundBodyPOST(); 61 std::string TestCompoundBodyPOST();
57 std::string TestEmptyDataPOST(); 62 std::string TestEmptyDataPOST();
58 std::string TestBinaryDataPOST(); 63 std::string TestBinaryDataPOST();
59 std::string TestCustomRequestHeader(); 64 std::string TestCustomRequestHeader();
60 std::string TestFailsBogusContentLength(); 65 std::string TestFailsBogusContentLength();
61 std::string TestStreamToFile(); 66 std::string TestStreamToFile();
62 std::string TestUntrustedSameOriginRestriction(); 67 std::string TestUntrustedSameOriginRestriction();
63 std::string TestTrustedSameOriginRestriction(); 68 std::string TestTrustedSameOriginRestriction();
64 std::string TestUntrustedCrossOriginRequest(); 69 std::string TestUntrustedCrossOriginRequest();
65 std::string TestTrustedCrossOriginRequest(); 70 std::string TestTrustedCrossOriginRequest();
66 std::string TestUntrustedJavascriptURLRestriction(); 71 std::string TestUntrustedJavascriptURLRestriction();
67 std::string TestTrustedJavascriptURLRestriction(); 72 std::string TestTrustedJavascriptURLRestriction();
68 std::string TestUntrustedHttpRequests(); 73 std::string TestUntrustedHttpRequests();
69 std::string TestTrustedHttpRequests(); 74 std::string TestTrustedHttpRequests();
70 std::string TestFollowURLRedirect(); 75 std::string TestFollowURLRedirect();
71 std::string TestAuditURLRedirect(); 76 std::string TestAuditURLRedirect();
72 std::string TestAbortCalls(); 77 std::string TestAbortCalls();
73 std::string TestUntendedLoad(); 78 std::string TestUntendedLoad();
74 std::string TestPrefetchBufferThreshold(); 79 std::string TestPrefetchBufferThreshold();
75 80
76 const PPB_FileIOTrusted* file_io_trusted_interface_; 81 const PPB_FileIOTrusted* file_io_trusted_interface_;
77 const PPB_URLLoaderTrusted* url_loader_trusted_interface_; 82 const PPB_URLLoaderTrusted* url_loader_trusted_interface_;
78 }; 83 };
79 84
80 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_ 85 #endif // PAPPI_TESTS_TEST_URL_LOADER_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_url_loader_proxy.cc ('k') | ppapi/tests/test_url_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698