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

Unified Diff: ppapi/tests/test_url_loader.cc

Issue 451923002: Add a X-Requested-With header to URL requests for PPAPI Flash (only). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment about -1. Created 6 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/tests/test_url_loader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_url_loader.cc
diff --git a/ppapi/tests/test_url_loader.cc b/ppapi/tests/test_url_loader.cc
index ca4ef7a779986016af2f5d2ce319d6d77ea8741c..0d78efad6e994a2e74a5dc9ac0498f57066cd60a 100644
--- a/ppapi/tests/test_url_loader.cc
+++ b/ppapi/tests/test_url_loader.cc
@@ -142,6 +142,7 @@ void TestURLLoader::RunTests(const std::string& filter) {
RUN_CALLBACK_TEST(TestURLLoader, AbortCalls, filter);
RUN_CALLBACK_TEST(TestURLLoader, UntendedLoad, filter);
RUN_CALLBACK_TEST(TestURLLoader, PrefetchBufferThreshold, filter);
+ RUN_CALLBACK_TEST(TestURLLoader, XRequestedWithHeader, filter);
// These tests connect to localhost with privacy mode enabled:
RUN_CALLBACK_TEST(TestURLLoader, UntrustedSameOriginRestriction, filter);
RUN_CALLBACK_TEST(TestURLLoader, UntrustedCrossOriginRequest, filter);
@@ -860,5 +861,17 @@ std::string TestURLLoader::TestPrefetchBufferThreshold() {
PASS();
}
+// TODO(viettrungluu): This test properly belongs elsewhere. It tests that
+// Chrome properly tags URL requests made on behalf of Pepper plugins (with an
+// X-Requested-With header), but this isn't, strictly speaking, a PPAPI
+// behavior.
+std::string TestURLLoader::TestXRequestedWithHeader() {
+ pp::URLRequestInfo request(instance_);
+ request.SetURL("/echoheader?X-Requested-With");
+ // The name and version of the plugin is set from the command-line (see
+ // chrome/test/ppapi/ppapi_test.cc.
+ return LoadAndCompareBody(request, "PPAPITests/1.2.3");
+}
+
// TODO(viettrungluu): Add tests for Get{Upload,Download}Progress, Close
// (including abort tests if applicable).
« no previous file with comments | « ppapi/tests/test_url_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698