summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjingzhao@chromium.org <jingzhao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-23 10:12:02 +0000
committerjingzhao@chromium.org <jingzhao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-23 10:12:02 +0000
commit90a0171891a1528d6ae7f441affb8d04d3c93935 (patch)
tree05491049f42eed7f3f21ccc4dcb76177420706a4
parent5a96988b6a5a3330d9b0d4bf0d8f23338b8d9e1e (diff)
downloadchromium_src-90a0171891a1528d6ae7f441affb8d04d3c93935.zip
chromium_src-90a0171891a1528d6ae7f441affb8d04d3c93935.tar.gz
chromium_src-90a0171891a1528d6ae7f441affb8d04d3c93935.tar.bz2
Allow POST method when converting file protocol to http protocol for layout tests.
When running layout tests on Android, we host test files on a Linux/Mac machine, convert file requests to http requests, and forward http requests from Android to the same port on the host machine. The following tests use POST method and failed at DCHECK(params->method == "GET" || params->method.empty()): fast/events/popup-allowed-from-gesture-initiated-form-submit.html fast/forms/document-write.html fast/forms/form-and-frame-interaction-retains-values.html fast/forms/form-data-encoding-normalization-overrun.html fast/forms/form-post-urlencoded.html fast/forms/formmethod-attribute-button-html.html fast/forms/formmethod-attribute-input-html.html fast/forms/submit-to-url-fragment.html fast/forms/xss-auditor-doesnt-crash-on-post-submit.html fast/history/form-submit-in-frame-via-onclick.html fast/history/form-submit-in-frame.html fast/loader/form-submission-after-beforeunload-cancel.html fast/loader/form-submit-aborts-parsing.html fast/loader/submit-form-while-parsing-1.xhtml The following test loads an image referred by the test page, and failed at DCHECK(params->referrer.is_empty()): http/tests/security/local-image-from-remote-whitelisted.html BUG=http://b/5655809 Review URL: http://codereview.chromium.org/8632006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111342 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index 4b15a5b..6ce3e9c 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
@@ -585,15 +585,13 @@ class RequestProxy : public net::URLRequest::Delegate,
if (!g_file_over_http_params || !params->url.SchemeIsFile())
return;
- // For file protocol, method must be GET or NULL.
- DCHECK(params->method == "GET" || params->method.empty());
- // File protocol doesn't support upload.
- DCHECK(!params->upload);
- DCHECK(params->referrer.is_empty());
+ // For file protocol, method must be GET, POST or NULL.
+ DCHECK(params->method == "GET" || params->method == "POST" ||
+ params->method.empty());
DCHECK(!params->download_to_file);
- // "GET" is the only method we allow.
- params->method = "GET";
+ if (params->method.empty())
+ params->method = "GET";
std::string original_request = params->url.spec();
std::string::size_type found =
original_request.find(g_file_over_http_params->file_path_template);