Commit 90a01718 authored by jingzhao@chromium.org's avatar jingzhao@chromium.org

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
parent 5a96988b
......@@ -585,14 +585,12 @@ 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.
if (params->method.empty())
params->method = "GET";
std::string original_request = params->url.spec();
std::string::size_type found =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment