- Revision
- 158726
- Author
- [email protected]
- Date
- 2013-11-05 23:30:55 -0800 (Tue, 05 Nov 2013)
Log Message
Add more tests for formaction, formenctype, formmethod, formnovalidate, and formtarget attributes
https://bugs.webkit.org/show_bug.cgi?id=123876
Reviewed by Andreas Kling.
Merge tests from https://chromium.googlesource.com/chromium/blink/+/5f4ccd416fec39a6878af66e87bda191cc59ea7e
so that we won't introduce regressions they had.
* fast/forms/formaction-attribute-expected.txt:
* fast/forms/formaction-attribute.html:
* fast/forms/formmethod-attribute-input-2-expected.txt: Added.
* fast/forms/formmethod-attribute-input-2.html: Added.
* fast/forms/formtarget-attribute-input-2-expected.txt: Added.
* fast/forms/formtarget-attribute-input-2.html: Added.
* fast/forms/interactive-validation-formnovalidate-2-expected.txt: Added.
* fast/forms/interactive-validation-formnovalidate-2.html: Added.
* fast/forms/mailto/formenctype-attribute-input-2-expected.txt: Added.
* fast/forms/mailto/formenctype-attribute-input-2.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (158725 => 158726)
--- trunk/LayoutTests/ChangeLog 2013-11-06 07:20:02 UTC (rev 158725)
+++ trunk/LayoutTests/ChangeLog 2013-11-06 07:30:55 UTC (rev 158726)
@@ -1,5 +1,26 @@
2013-11-05 Ryosuke Niwa <[email protected]>
+ Add more tests for formaction, formenctype, formmethod, formnovalidate, and formtarget attributes
+ https://bugs.webkit.org/show_bug.cgi?id=123876
+
+ Reviewed by Andreas Kling.
+
+ Merge tests from https://chromium.googlesource.com/chromium/blink/+/5f4ccd416fec39a6878af66e87bda191cc59ea7e
+ so that we won't introduce regressions they had.
+
+ * fast/forms/formaction-attribute-expected.txt:
+ * fast/forms/formaction-attribute.html:
+ * fast/forms/formmethod-attribute-input-2-expected.txt: Added.
+ * fast/forms/formmethod-attribute-input-2.html: Added.
+ * fast/forms/formtarget-attribute-input-2-expected.txt: Added.
+ * fast/forms/formtarget-attribute-input-2.html: Added.
+ * fast/forms/interactive-validation-formnovalidate-2-expected.txt: Added.
+ * fast/forms/interactive-validation-formnovalidate-2.html: Added.
+ * fast/forms/mailto/formenctype-attribute-input-2-expected.txt: Added.
+ * fast/forms/mailto/formenctype-attribute-input-2.html: Added.
+
+2013-11-05 Ryosuke Niwa <[email protected]>
+
Mac Mavericks rebaseline after r158714.
* platform/mac/fast/forms/textAreaLineHeight-expected.txt:
Modified: trunk/LayoutTests/fast/forms/formaction-attribute-expected.txt (158725 => 158726)
--- trunk/LayoutTests/fast/forms/formaction-attribute-expected.txt 2013-11-06 07:20:02 UTC (rev 158725)
+++ trunk/LayoutTests/fast/forms/formaction-attribute-expected.txt 2013-11-06 07:30:55 UTC (rev 158726)
@@ -4,6 +4,7 @@
PASS The formaction attribute in the input tag was used.
+PASS The formaction attribute in the input tag was used.
PASS The formaction attribute in the button tag was used.
PASS The formaction attribute in the button tag was used.
PASS successfullyParsed is true
Modified: trunk/LayoutTests/fast/forms/formaction-attribute.html (158725 => 158726)
--- trunk/LayoutTests/fast/forms/formaction-attribute.html 2013-11-06 07:20:02 UTC (rev 158725)
+++ trunk/LayoutTests/fast/forms/formaction-attribute.html 2013-11-06 07:30:55 UTC (rev 158726)
@@ -2,6 +2,7 @@
<html>
<head>
<script src=""
+<script src=""
</head>
<body>
<p id="description"></p>
@@ -50,6 +51,11 @@
testFailed('Both of the action and the formaction attributes were ignored.');
doneAction = false;
+clickElement(input);
+if (!doneAction)
+ testFailed('Both of the action and the formaction attributes were ignored.');
+
+doneAction = false;
var button = document.getElementById('button2');
button.click();
if (!doneAction)
Added: trunk/LayoutTests/fast/forms/formmethod-attribute-input-2-expected.txt (0 => 158726)
--- trunk/LayoutTests/fast/forms/formmethod-attribute-input-2-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/formmethod-attribute-input-2-expected.txt 2013-11-06 07:30:55 UTC (rev 158726)
@@ -0,0 +1,10 @@
+Test for the formmethod attribute in input tags.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS The formmethod attribute was successfully used
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/formmethod-attribute-input-2.html (0 => 158726)
--- trunk/LayoutTests/fast/forms/formmethod-attribute-input-2.html (rev 0)
+++ trunk/LayoutTests/fast/forms/formmethod-attribute-input-2.html 2013-11-06 07:30:55 UTC (rev 158726)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script src=""
+<form method="get" action=""
+ <input type="hidden" name="hidden" value="I am hidden">
+ <input id="button" formmethod="post" type="submit" name="button">
+</form>
+<script>
+description("Test for the formmethod attribute in input tags.");
+
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+var button = document.getElementById('button');
+
+if (document.URL.substring(0, 4) == "file") {
+ if (document.URL.indexOf('?') == -1)
+ clickElement(button);
+ else {
+ if (document.URL.substring(document.URL.indexOf('?') + 1, document.URL.length) == "")
+ testPassed('The formmethod attribute was successfully used');
+ else
+ testFailed('The formmethod attribute was not used');
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+}
+
+</script>
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/forms/formtarget-attribute-input-2-expected.txt (0 => 158726)
--- trunk/LayoutTests/fast/forms/formtarget-attribute-input-2-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/formtarget-attribute-input-2-expected.txt 2013-11-06 07:30:55 UTC (rev 158726)
@@ -0,0 +1,11 @@
+Test for the formtarget attribute in an input tag.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS The formtarget attribute was successfully used.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
Added: trunk/LayoutTests/fast/forms/formtarget-attribute-input-2.html (0 => 158726)
--- trunk/LayoutTests/fast/forms/formtarget-attribute-input-2.html (rev 0)
+++ trunk/LayoutTests/fast/forms/formtarget-attribute-input-2.html 2013-11-06 07:30:55 UTC (rev 158726)
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<body _onload_="runTest()">
+<script src=""
+<script src=""
+<form action="" method="GET" target="failFrame">
+<input type="submit" id="button" formtarget="passFrame">
+</form>
+<script>
+description("Test for the formtarget attribute in an input tag.");
+
+function runTest() {
+ if (window.testRunner) {
+ testRunner.setAllowUniversalAccessFromFileURLs(true);
+ testRunner.waitUntilDone();
+ }
+ clickElement(document.getElementById('button'));
+}
+
+function passFrameLoaded() {
+ if (document.getElementById('pass').contentDocument.URL == "about:blank")
+ return;
+ testPassed("The formtarget attribute was successfully used.");
+ isSuccessfullyParsed();
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
+function failFrameLoaded() {
+ if (document.getElementById('fail').contentDocument.URL == "about:blank")
+ return;
+ testFailed("The formtarget attribute was not used.");
+ isSuccessfullyParsed();
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+</script>
+<iframe src="" id="pass" name="passFrame" _onload_="passFrameLoaded()"></iframe>
+<iframe src="" id="fail" name="failFrame" _onload_="failFrameLoaded()"></iframe>
+</body>
+</html>
Added: trunk/LayoutTests/fast/forms/interactive-validation-formnovalidate-2-expected.txt (0 => 158726)
--- trunk/LayoutTests/fast/forms/interactive-validation-formnovalidate-2-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/interactive-validation-formnovalidate-2-expected.txt 2013-11-06 07:30:55 UTC (rev 158726)
@@ -0,0 +1,9 @@
+Test if the form is submitted with a submit button with formnovalidate.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS The form should not be submitted.
+PASS location.search.indexOf("i0=") != -1 is true
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/forms/interactive-validation-formnovalidate-2.html (0 => 158726)
--- trunk/LayoutTests/fast/forms/interactive-validation-formnovalidate-2.html (rev 0)
+++ trunk/LayoutTests/fast/forms/interactive-validation-formnovalidate-2.html 2013-11-06 07:30:55 UTC (rev 158726)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script src=""
+<form id="f" action=""
+<input type="hidden" name="submitted" value="true">
+<input name="i0" required id="i0">
+<input type="submit" id="s" formnovalidate>
+</form>
+<script>
+description('Test if the form is submitted with a submit button with formnovalidate.');
+
+function startOrVerify() {
+ var query = window.location.search;
+ if (query.indexOf('submitted=true') != -1) {
+ testPassed('The form should not be submitted.');
+ shouldBeTrue('location.search.indexOf("i0=") != -1');
+ debug('TEST COMPLETE');
+ if (window.testRunner)
+ testRunner.notifyDone();
+ } else {
+ // HTMLFormElement::submit() skips validation. Use the submit button.
+ clickElement(document.getElementById('s'));
+ testFailed('The form was not submitted.');
+ }
+}
+
+if (window.testRunner)
+ testRunner.waitUntilDone();
+window._onload_ = startOrVerify;
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/fast/forms/mailto/formenctype-attribute-input-2-expected.txt (0 => 158726)
--- trunk/LayoutTests/fast/forms/mailto/formenctype-attribute-input-2-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/forms/mailto/formenctype-attribute-input-2-expected.txt 2013-11-06 07:30:55 UTC (rev 158726)
@@ -0,0 +1,2 @@
+Policy delegate: attempt to load mailto:?body=to%3Done%40example.org%0D%0Abody%3DLine%201%0D%0ALine%202%0D%0A%40%0D%0A%3D%2C%3B%3F%20%0D%0A with navigation type 'form submitted' originating from INPUT > FORM > BODY > HTML > #document
+Field 1: Field 2:
Added: trunk/LayoutTests/fast/forms/mailto/formenctype-attribute-input-2.html (0 => 158726)
--- trunk/LayoutTests/fast/forms/mailto/formenctype-attribute-input-2.html (rev 0)
+++ trunk/LayoutTests/fast/forms/mailto/formenctype-attribute-input-2.html 2013-11-06 07:30:55 UTC (rev 158726)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<body _onload_="test()">
+<script src=""
+<form method="post" action=""
+Field 1: <input type="text" size="10" maxlength="40" name="to" value="[email protected]">
+Field 2: <textarea name="body">Line 1
+Line 2
+@&=,;?+</textarea>
+<input type="submit" id="submit" formenctype="text/plain">
+</form>
+<script>
+function test() {
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitForPolicyDelegate();
+ }
+ clickElement(document.getElementById("submit"));
+ // The resultant URL should be
+ // mailto:?body=to%3Done%40example.org%0D%0Abody...
+ // not mailto:?body=to%3Done%2540example.org%26body...
+}
+</script>
+</body>
+</html>