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

Side by Side Diff: LayoutTests/http/tests/local/formdata/send-form-data-with-bad-string.html

Issue 74133005: Remove several uses of toWebCoreStringWithNullCheck(v8::Handle<v8::Value>) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../../../resources/js-test.js"></script>
5 <script>
6 description("Test that passing bad strings to FormData.append() throws and abort s properly.");
7
8 var xhr = new XMLHttpRequest();
9 xhr.open('POST', 'http://127.0.0.1:8000/xmlhttprequest/resources/post-echo.cgi', false);
10 var badString = { toString: function() { throw "Exception in toString()"; } };
11
12 var formData = new FormData();
13 shouldThrow("formData.append(badString, 'test')", "'Exception in toString()'");
14 shouldThrow("formData.append('textarea', badString)", "'Exception in toString()' ");
15 shouldThrow("formData.append('blob', new Blob(['']), badString)", "'Exception in toString()'");
16
17 xhr.send(formData);
18 if (xhr.readyState !== 4 || xhr.status !== 200) {
19 testFailed('xhr.readyState = ' + xhr.readyState + ', xhr.status = ' + xhr.st atus);
20 return;
21 }
22
23 shouldBe("xhr.response.indexOf('test')", "-1");
24 shouldBe("xhr.response.indexOf('textarea')", "-1");
25 shouldBe("xhr.response.indexOf('blob')", "-1");
26 </script>
27 </body>
28 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698