OLD | NEW |
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 #include "ppapi/tests/test_url_loader.h" | 5 #include "ppapi/tests/test_url_loader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <string> | 10 #include <string> |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Dnt:\n")); | 604 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Dnt:\n")); |
605 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Expect:\n")); | 605 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Expect:\n")); |
606 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Host:\n")); | 606 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Host:\n")); |
607 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Keep-Alive:\n")); | 607 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Keep-Alive:\n")); |
608 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Referer:\n")); | 608 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Referer:\n")); |
609 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "TE:\n")); | 609 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "TE:\n")); |
610 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Trailer:\n")); | 610 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Trailer:\n")); |
611 ASSERT_EQ(PP_ERROR_NOACCESS, | 611 ASSERT_EQ(PP_ERROR_NOACCESS, |
612 OpenUntrusted("GET", "Transfer-Encoding:\n")); | 612 OpenUntrusted("GET", "Transfer-Encoding:\n")); |
613 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Upgrade:\n")); | 613 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Upgrade:\n")); |
614 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "User-Agent:\n")); | |
615 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Via:\n")); | 614 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Via:\n")); |
616 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted( | 615 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted( |
617 "GET", "Proxy-Authorization: Basic dXNlcjpwYXNzd29yZA==:\n")); | 616 "GET", "Proxy-Authorization: Basic dXNlcjpwYXNzd29yZA==:\n")); |
618 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Sec-foo:\n")); | 617 ASSERT_EQ(PP_ERROR_NOACCESS, OpenUntrusted("GET", "Sec-foo:\n")); |
619 } | 618 } |
620 // Untrusted requests with custom referrer should fail. | 619 // Untrusted requests with custom referrer should fail. |
621 { | 620 { |
622 pp::URLRequestInfo request(instance_); | 621 pp::URLRequestInfo request(instance_); |
623 request.SetCustomReferrerURL("http://www.google.com/"); | 622 request.SetCustomReferrerURL("http://www.google.com/"); |
624 | 623 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 std::string TestURLLoader::TestXRequestedWithHeader() { | 873 std::string TestURLLoader::TestXRequestedWithHeader() { |
875 pp::URLRequestInfo request(instance_); | 874 pp::URLRequestInfo request(instance_); |
876 request.SetURL("/echoheader?X-Requested-With"); | 875 request.SetURL("/echoheader?X-Requested-With"); |
877 // The name and version of the plugin is set from the command-line (see | 876 // The name and version of the plugin is set from the command-line (see |
878 // chrome/test/ppapi/ppapi_test.cc. | 877 // chrome/test/ppapi/ppapi_test.cc. |
879 return LoadAndCompareBody(request, "PPAPITests/1.2.3"); | 878 return LoadAndCompareBody(request, "PPAPITests/1.2.3"); |
880 } | 879 } |
881 | 880 |
882 // TODO(viettrungluu): Add tests for Get{Upload,Download}Progress, Close | 881 // TODO(viettrungluu): Add tests for Get{Upload,Download}Progress, Close |
883 // (including abort tests if applicable). | 882 // (including abort tests if applicable). |
OLD | NEW |