| 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 // Common definitions for test_post?.js. |
| 6 |
| 5 var dirName = "requestBody/"; | 7 var dirName = "requestBody/"; |
| 6 | 8 |
| 7 function sendPost(formFile, parseableForm) { | 9 function sendPost(formFile, parseableForm) { |
| 8 // The following variables must be updated when files in |dirName| change. | 10 // The following variables must be updated when files in |dirName| change. |
| 9 var formData = { | 11 var formData = { |
| 10 "check": ["option_A"], | 12 "check": ["option_A"], |
| 11 "password": ["password"], | 13 "password": ["password"], |
| 12 "radio": ["Yes"], | 14 "radio": ["Yes"], |
| 13 "select": ["one"], | 15 "select": ["one"], |
| 14 "text\"1\u011B\u0161\u00FD\u4EBA\r\n \r\n": ["TEST_TEXT_1"], | 16 "text\"1\u011B\u0161\u00FD\u4EBA\r\n \r\n": ["TEST_TEXT_1"], |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 [ // event order | 123 [ // event order |
| 122 ["a-onBeforeRequest", "a-onResponseStarted", "a-onCompleted", | 124 ["a-onBeforeRequest", "a-onResponseStarted", "a-onCompleted", |
| 123 "s-onBeforeRequest", "s-onResponseStarted", "s-onCompleted", | 125 "s-onBeforeRequest", "s-onResponseStarted", "s-onCompleted", |
| 124 "b-onBeforeRequest", "b-onResponseStarted", "b-onCompleted"] | 126 "b-onBeforeRequest", "b-onResponseStarted", "b-onCompleted"] |
| 125 ], | 127 ], |
| 126 {urls: ["<all_urls>"]}, // filter | 128 {urls: ["<all_urls>"]}, // filter |
| 127 ["requestBody"]); | 129 ["requestBody"]); |
| 128 navigateAndWait(getURL(dirName + formFile)); | 130 navigateAndWait(getURL(dirName + formFile)); |
| 129 } | 131 } |
| 130 } | 132 } |
| 131 | |
| 132 runTests([ | |
| 133 // Navigates to a page with a form and submits it, generating a POST request. | |
| 134 // First two result in url-encoded form. | |
| 135 sendPost('no-enctype.html', true), | |
| 136 sendPost('urlencoded.html', true), | |
| 137 // Third results in multipart-encoded form. | |
| 138 sendPost('multipart.html', true), | |
| 139 // Fourth results in unparseable form, and thus raw data string. | |
| 140 sendPost('plaintext.html', false), | |
| 141 ]); | |
| OLD | NEW |