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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html

Issue 347653003: XMLHttpRequest must build a request using the given method as-is for non-standard types (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Write async tests Created 6 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html
new file mode 100644
index 0000000000000000000000000000000000000000..8f95a20fb15941e0fc2f219baecdb87c4343de34
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>XMLHttpRequest: open() - allowed case in/sensitive methods test</title>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <p>Valid methods per step-5 of http://xhr.spec.whatwg.org/#the-open()-method.</p>
+ <script type="text/javascript">
+ if (window.testRunner)
+ window.testRunner.dumpAsText();
tyoshino (SeeGerritForStatus) 2014/06/20 02:13:34 this is included in testharnessreport.js
maheshkk 2014/06/20 04:53:19 Done.
+
+ function testMethod(methodName, lastTest) {
tyoshino (SeeGerritForStatus) 2014/06/20 02:13:34 lastTest is not used?
maheshkk 2014/06/20 04:53:19 Done. Had it for async_test usage but got it worki
+ var client = new XMLHttpRequest();
+ client.open(methodName, "resources/request-method.php");
tyoshino (SeeGerritForStatus) 2014/06/20 02:13:34 how about naming this echo-request-method.php?
maheshkk 2014/06/20 04:53:19 Done.
+ client.onreadystatechange = function(event) {
+ if (event.target.readyState == 4)
+ assert_equals(client.getResponseHeader("x-custom-request-method"), methodName.toUpperCase());
+ }
+ client.send(null);
+ }
+
+ test(function() { testMethod("PUT"); });
+ test(function() { testMethod("Put"); });
+ test(function() { testMethod("DELETE"); });
+ test(function() { testMethod("DeLeTe"); });
+ test(function() { testMethod("HEAD"); });
+ test(function() { testMethod("hEAd"); });
+ test(function() { testMethod("OPTIONS"); });
+ test(function() { testMethod("OPtiOns"); });
+ test(function() { testMethod("POST"); });
+ test(function() { testMethod("post"); });
+ test(function() { testMethod("GET"); });
+ test(function() { testMethod("gEt", true); });
+ </script>
+ </body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698