Fixed TTS-1875 to move 7 TCs from delta to tct-cors-w3c-tests
authoryuhanx.xu <yuhanx.xu@intel.com>
Tue, 13 Aug 2013 08:50:22 +0000 (16:50 +0800)
committerwanmingx.lin <wanmingx.lin@intel.com>
Wed, 14 Aug 2013 12:32:15 +0000 (20:32 +0800)
Signed-off-by: yuhanx.xu <yuhanx.xu@intel.com>
17 files changed:
tct-cors-w3c-tests/cors/cors_XMLHttpRequest_add_max_age.html [new file with mode: 0644]
tct-cors-w3c-tests/cors/cors_XMLHttpRequest_allow_credentials_true.html [new file with mode: 0644]
tct-cors-w3c-tests/cors/cors_XMLHttpRequest_base.html
tct-cors-w3c-tests/cors/cors_XMLHttpRequest_credentials_false_origin.html [new file with mode: 0644]
tct-cors-w3c-tests/cors/cors_XMLHttpRequest_get.html
tct-cors-w3c-tests/cors/cors_XMLHttpRequest_getResponseHeader_not_null.html [new file with mode: 0644]
tct-cors-w3c-tests/cors/cors_XMLHttpRequest_getResponseHeader_null.html [new file with mode: 0644]
tct-cors-w3c-tests/cors/cors_XMLHttpRequest_get_true.html [new file with mode: 0644]
tct-cors-w3c-tests/cors/cors_XMLHttpRequest_post.html
tct-cors-w3c-tests/cors/cors_XMLHttpRequest_post_true.html [new file with mode: 0644]
tct-cors-w3c-tests/cors/support/COPYING [new file with mode: 0644]
tct-cors-w3c-tests/cors/support/cgi/cors_allow_origin_asterisk.php [new file with mode: 0755]
tct-cors-w3c-tests/cors/support/cgi/cors_credential_true.php [new file with mode: 0755]
tct-cors-w3c-tests/cors/support/cors_allow_origin_asterisk.php [new file with mode: 0644]
tct-cors-w3c-tests/cors/support/cors_credential_true.php [new file with mode: 0644]
tct-cors-w3c-tests/cors/support/poster.png [new file with mode: 0644]
tct-cors-w3c-tests/tests.xml

diff --git a/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_add_max_age.html b/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_add_max_age.html
new file mode 100644 (file)
index 0000000..f249b7b
--- /dev/null
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2013 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+  of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+  may be used to endorse or promote products derived from this work without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+        Fan,Weiwei <weiwix.fan@intel.com>
+        Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+  <head>
+    <title>CORS Test: cors_XMLHttpRequest_add_max_age</title>
+    <link rel="author" title="Intel" href="http://www.intel.com" />
+    <link rel="help" href="http://www.w3.org/TR/2012/WD-cors-20120403" />
+    <meta name="flags" content="" />
+    <meta name="assert" content="Check if optionally add a single Access-Control-Max-Age header with as value the amount of seconds the user agent is allowed to cache the result of the request" />
+    <script src="./support/path.js"></script>
+    <script src="../resources/testharness.js"></script>
+    <script src="../resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+        var t = async_test(document.title, {timeout:2000});
+        var client = new XMLHttpRequest();
+        var url = otherDomain + "/opt/tct-cors-w3c-tests/cors/support/cors_credential_false.php";
+        var ok = 200; // The code indicate success
+        var maxAge = "30000";
+
+        try {
+            //Preflight Request
+            client.open('GET', url, true);
+            client.withCredentials = false;
+            client.onreadystatechange = t.step_func(function () {
+                if (client.readyState == 4) {
+                    assert_equals(client.status, ok, "the status code");
+                    assert_equals(client.getResponseHeader("Access-Control-Max-Age"), maxAge, "the response header max age");
+                    t.done();
+                }
+            });
+            client.onerror = t.step_func(function () {
+                assert_unreached("corss origin request failed");
+                t.done();
+            });
+            client.send();
+        } catch (ex) {
+            t.step(function () {
+                assert_unreached("throw an exception" + ex);
+            });
+            t.done();
+        }
+    </script>
+  </body>
+</html>
diff --git a/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_allow_credentials_true.html b/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_allow_credentials_true.html
new file mode 100644 (file)
index 0000000..96d3895
--- /dev/null
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2013 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+  of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+  may be used to endorse or promote products derived from this work without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+        Fan,Weiwei <weiwix.fan@intel.com>
+        Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+  <head>
+    <title>CORS Test: cors_XMLHttpRequest_allow_credentials_true</title>
+    <link rel="author" title="Intel" href="http://www.intel.com" />
+    <link rel="help" href="http://www.w3.org/TR/2012/WD-cors-20120403" />
+    <meta name="flags" content="" />
+    <meta name="assert" content="Check if the response uses the value of the Origin header as value, and adds a single Access-Control-Allow-Credentials header with the literal string 'true' as value when the resource supports credentials add a single Access-Control-Allow-Origin header" />
+    <script src="./support/path.js"></script>
+    <script src="../resources/testharness.js"></script>
+    <script src="../resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+        var t = async_test(document.title, {timeout:2000});
+        var client = new XMLHttpRequest();
+        var url = otherDomain + "/opt/tct-cors-w3c-tests/cors/support/cors_credential_true.php";
+        var ok = 200; // The code indicate success
+
+        try {
+            client.open('GET', url, true);
+            client.withCredentials = true; // Credentials flag is true
+            client.onreadystatechange = t.step_func(function () {
+                if (client.readyState == 4) {
+                    assert_equals(client.status, ok, "the status code");
+                    assert_equals(client.getResponseHeader("Access-Control-Allow-Credentials"), "true", "the allow Credentials");
+                    t.done();
+                }
+            });
+            client.onerror = t.step_func(function () {
+                assert_unreached("corss origin request failed");
+                t.done();
+            });
+            client.send();
+        } catch (ex) {
+            t.step(function () {
+                assert_unreached("throw an exception" + ex);
+            });
+            t.done();
+        }
+    </script>
+  </body>
+</html>
index 719f7d4cc8a0b963ab80bfe4a3ef829de33d89a2..d0e3d79c0d8aed5ca011deefd6bf3bc03098cbac 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <!--
-Copyright (c) 2012 Intel Corporation.
+Copyright (c) 2013 Intel Corporation.
 
 Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
@@ -26,7 +26,8 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 Authors:
-        Fan, Weiwei <weiwix.fan@intel.com>
+        Fan,Weiwei <weiwix.fan@intel.com>
+        Xu,Yuhan <yuhanx.xu@intel.com>
 
 -->
 
@@ -37,25 +38,25 @@ Authors:
     <link rel="help" href="http://www.w3.org/TR/2012/WD-cors-20120403" />
     <meta name="flags" content="" />
     <meta name="assert" content="Check if example of using XMLHttpRequest a client-side Web application can corss origin share the resource" />
+    <script src="./support/path.js"></script>
     <script src="../resources/testharness.js"></script>
     <script src="../resources/testharnessreport.js"></script>
-    <script type="text/javascript" src="./support/path.js"></script>
   </head>
   <body>
     <div id="log"></div>
-    <script type="text/javascript">
-        var t = async_test(document.title);
+    <script>
+        var t = async_test(document.title, {timeout:2000});
         var client = new XMLHttpRequest();
         var url = otherDomain + "/opt/tct-cors-w3c-tests/cors/support/cors_credential_false.php";
         var ok = 200; // The code indicate success
 
         client.open('GET', url, true);
-        client.onreadystatechange = t.step_func(function () {  
+        client.onreadystatechange = t.step_func(function () {
             if (client.readyState == 4) {
-                assert_equals(client.status, ok, "the statu code");
+                assert_equals(client.status, ok, "the status code");
                 assert_equals(client.responseText, "HelloWorld", "the response text");
                 t.done();
-            }  
+            }
         });
         client.onerror = t.step_func(function () {
             assert_unreached("the request has failed");
diff --git a/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_credentials_false_origin.html b/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_credentials_false_origin.html
new file mode 100644 (file)
index 0000000..8481d74
--- /dev/null
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2013 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+  of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+  may be used to endorse or promote products derived from this work without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+        Fan,Weiwei <weiwix.fan@intel.com>
+        Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+  <head>
+    <title>CORS Test: cors_XMLHttpRequest_credentials_false_origin</title>
+    <link rel="author" title="Intel" href="http://www.intel.com" />
+    <link rel="help" href="http://www.w3.org/TR/2012/WD-cors-20120403" />
+    <meta name="flags" content="" />
+    <meta name="assert" content="Check if the response adds a single Access-Control-Allow-Origin header and literal string '*' as value when the resource does not supports credentials add a single Access-Control-Allow-Origin header" />
+    <script src="./support/path.js"></script>
+    <script src="../resources/testharness.js"></script>
+    <script src="../resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+        var t = async_test(document.title, {timeout:2000});
+        var client = new XMLHttpRequest();
+        var url = otherDomain + "/opt/tct-cors-w3c-tests/cors/support/cors_allow_origin_asterisk.php";
+        var ok = 200; // The code indicate success
+
+        try {
+            client.open('GET', url, true);
+            client.withCredentials = false;
+            client.onreadystatechange = t.step_func(function () {
+                if (client.readyState == 4) {
+                    assert_equals(client.status, ok, "the status code");
+                    assert_equals(client.getResponseHeader("Access-Control-Allow-Origin"), "*", "the allow origin");
+                    t.done();
+                }
+            });
+            client.onerror = t.step_func(function () {
+                assert_unreached("corss origin request failed");
+                t.done();
+            });
+            client.send();
+        } catch (ex) {
+            t.step(function () {
+                assert_unreached("throw an exception" + ex);
+            });
+            t.done();
+        }
+    </script>
+  </body>
+</html>
index f409266ad9a2762764939c5ce0b6b824e24390b1..0d12b6192522561b4977d1c320d261ec19731108 100644 (file)
@@ -1,32 +1,33 @@
 <!DOCTYPE html>
 <!--
-Copyright (c) 2012 Intel Corporation.
+Copyright (c) 2013 Intel Corporation.
 
-Redistribution and use in source and binary forms, with or without modification, 
+Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
 
-* Redistributions of works must retain the original copyright notice, this list 
+* Redistributions of works must retain the original copyright notice, this list
   of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the original copyright notice, 
-  this list of conditions and the following disclaimer in the documentation 
+* Redistributions in binary form must reproduce the original copyright notice,
+  this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.
-* Neither the name of Intel Corporation nor the names of its contributors 
-  may be used to endorse or promote products derived from this work without 
+* Neither the name of Intel Corporation nor the names of its contributors
+  may be used to endorse or promote products derived from this work without
   specific prior written permission.
 
-THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" 
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
-ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, 
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
-  
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 Authors:
         Fan,Weiwei <weiwix.fan@intel.com>
+        Xu,Yuhan <yuhanx.xu@intel.com>
 
 -->
 
@@ -37,13 +38,13 @@ Authors:
     <link rel="help" href="http://www.w3.org/TR/2012/WD-cors-20120403" />
     <meta name="flags" content="" />
     <meta name="assert" content="Check if the XMLHttpRequest supports CORS when the request method is get" />
+    <script src="./support/path.js"></script>
     <script src="../resources/testharness.js"></script>
     <script src="../resources/testharnessreport.js"></script>
-    <script type="text/javascript" src="./support/path.js"></script>
   </head>
   <body>
     <div id="log"></div>
-    <script type="text/javascript">
+    <script>
         var t = async_test(document.title, { timeout: 3000 });
 
         var url = otherDomain + "/opt/tct-cors-w3c-tests/cors/support/cors_echo.php?message=test";
diff --git a/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_getResponseHeader_not_null.html b/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_getResponseHeader_not_null.html
new file mode 100644 (file)
index 0000000..0ab67a2
--- /dev/null
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2013 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+  of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+  may be used to endorse or promote products derived from this work without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+        Fan,Weiwei <weiwix.fan@intel.com>
+        Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+  <head>
+    <title>CORS Test: cors_XMLHttpRequest_getResponseHeader_not_null</title>
+    <link rel="author" title="Intel" href="http://www.intel.com" />
+    <link rel="help" href="http://www.w3.org/TR/2012/WD-cors-20120403" />
+    <meta name="flags" content="" />
+    <meta name="assert" content="Check if the getResponseHeader() method of XMLHttpRequest will return valid value when the field name is an ASCII case-insensitive match for one of the values of the Access-Control-Expose-Headers headers" />
+    <script src="./support/path.js"></script>
+    <script src="../resources/testharness.js"></script>
+    <script src="../resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+        var t = async_test(document.title, {timeout:2000});
+        var client = new XMLHttpRequest();
+        var url = otherDomain + "/opt/tct-cors-w3c-tests/cors/support/cors_credential_false.php";
+        var ok = 200; // The code indicate success
+
+        client.open('GET', url, true);
+        client.onreadystatechange = t.step_func(function(){
+            if (client.readyState == 4) {
+                assert_equals(client.status, ok, "the status code");
+                assert_not_equals(client.getResponseHeader("Server"), null);
+                t.done();
+            }
+        });
+        client.onerror = t.step_func(function () {
+            assert_unreached("the request has failed");
+            t.done();
+        });
+        client.send();
+    </script>
+  </body>
+</html>
diff --git a/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_getResponseHeader_null.html b/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_getResponseHeader_null.html
new file mode 100644 (file)
index 0000000..59cbbba
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2013 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+  of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+  may be used to endorse or promote products derived from this work without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+        Fan,Weiwei <weiwix.fan@intel.com>
+        Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+  <head>
+    <title>CORS Test: cors_XMLHttpRequest_getResponseHeader_null</title>
+    <link rel="author" title="Intel" href="http://www.intel.com" />
+    <link rel="help" href="http://www.w3.org/TR/2012/WD-cors-20120403" />
+    <meta name="flags" content="" />
+    <meta name="assert" content="Check if the getResponseHeader() method of XMLHttpRequest will return null when the field name does not match for one of the values of the Access-Control-Expose-Headers headers" />
+    <script src="./support/path.js"></script>
+    <script src="../resources/testharness.js"></script>
+    <script src="../resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+        var t = async_test(document.title, {timeout:2000});
+        var client = new XMLHttpRequest();
+        var url = otherDomain + "/opt/tct-cors-w3c-tests/cors/support/cors_credential_false.php";
+        var ok = 200; // The code indicate success
+
+        client.open('GET', url, true);
+        client.onreadystatechange = t.step_func(function(){
+            if (client.readyState == 4) {
+                assert_equals(client.status, ok, "the status code");
+                assert_equals(client.getResponseHeader("Date"), null);
+                t.done();
+            }
+        });
+        client.onerror = t.step_func(function () {
+            assert_unreached("the request has failed");
+            t.done();
+        });
+        client.send();
+    </script>
+  </body>
+</html>
+
diff --git a/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_get_true.html b/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_get_true.html
new file mode 100644 (file)
index 0000000..356bac3
--- /dev/null
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2013 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+  of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+  may be used to endorse or promote products derived from this work without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+        Fan,Weiwei <weiwix.fan@intel.com>
+        Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+  <head>
+    <title>CORS Test: cors_XMLHttpRequest_get_true</title>
+    <link rel="author" title="Intel" href="http://www.intel.com" />
+    <link rel="help" href="http://www.w3.org/TR/2012/WD-cors-20120403" />
+    <meta name="flags" content="" />
+    <meta name="assert" content="Check if the XMLHttpRequest supports CORS when the request method is get and async flag is true"/>
+    <script src="./support/path.js"></script>
+    <script src="../resources/testharness.js"></script>
+    <script src="../resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+        var t = async_test(document.title, { timeout: 3000 });
+
+        var url = otherDomain + "/opt/tct-cors-w3c-tests/cors/support/cors_echo.php?message=test";
+        var xhr = new XMLHttpRequest();
+        xhr.open('GET', url, true);
+        xhr.send(null);
+
+        xhr.onreadystatechange = t.step_func(function() {
+            if (xhr.readyState == 4) {
+                var text = xhr.responseText;
+                assert_equals(text, "test", "the XMLHttpRequest supports CORS when the request method is get and async flag is true");
+                t.done();
+            }
+        });
+        xhr.onerror = t.step_func(function(e) {
+            assert_unreached("the cors request has failed");
+            t.done();
+        });
+    </script>
+  </body>
+</html>
index 1226a8318e0dba999c7ab3fa30f8f7d14e2af055..559456b21aaa1077bc48fb5133284d63879806a9 100644 (file)
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <!--
-Copyright (c) 2012 Intel Corporation.
+Copyright (c) 2013 Intel Corporation.
 
 Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
@@ -27,6 +27,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 Authors:
         Fan,Weiwei <weiwix.fan@intel.com>
+        Xu,Yuhan <yuhanx.xu@intel.com>
 
 -->
 
@@ -37,13 +38,13 @@ Authors:
     <link rel="help" href="http://www.w3.org/TR/2012/WD-cors-20120403" />
     <meta name="flags" content="" />
     <meta name="assert" content="Check if the XMLHttpRequest supports CORS when the request method is post" />
+    <script src="./support/path.js"></script>
     <script src="../resources/testharness.js"></script>
     <script src="../resources/testharnessreport.js"></script>
-    <script type="text/javascript" src="./support/path.js"></script>
   </head>
   <body>
     <div id="log"></div>
-    <script type="text/javascript" >
+    <script>
         var t = async_test(document.title, { timeout: 3000 });
 
         var url = otherDomain + "/opt/tct-cors-w3c-tests/cors/support/cors_echo.php";
diff --git a/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_post_true.html b/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_post_true.html
new file mode 100644 (file)
index 0000000..962c277
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2013 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+  of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+  may be used to endorse or promote products derived from this work without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+        Fan,Weiwei <weiwix.fan@intel.com>
+        Xu,Yuhan <yuhanx.xu@intel.com>
+
+-->
+
+<html>
+  <head>
+    <title>CORS Test: cors_XMLHttpRequest_post</title>
+    <link rel="author" title="Intel" href="http://www.intel.com" />
+    <link rel="help" href="http://www.w3.org/TR/2012/WD-cors-20120403" />
+    <meta name="flags" content="" />
+    <meta name="assert" content="Check if the XMLHttpRequest supports CORS when the request method is post" />
+    <script src="./support/path.js"></script>
+    <script src="../resources/testharness.js"></script>
+    <script src="../resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+        var t = async_test(document.title, { timeout: 3000 });
+
+        var url = otherDomain + "/opt/tct-cors-w3c-tests/cors/support/cors_echo.php";
+        var xhr = new XMLHttpRequest();
+        xhr.open('post', url, true);
+        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+        xhr.send("message=test");
+
+        xhr.onreadystatechange = t.step_func(function() {
+            if (xhr.readyState == 4) {
+                var text = xhr.responseText;
+                assert_equals(text, "test", "the XMLHttpRequest supports CORS when the request method is post and the sync flag is true");
+                t.done();
+            }
+        });
+        xhr.onerror = t.step_func(function(e) {
+            assert_unreached("the cors request has failed");
+            t.done();
+        });
+    </script>
+  </body>
+</html>
diff --git a/tct-cors-w3c-tests/cors/support/COPYING b/tct-cors-w3c-tests/cors/support/COPYING
new file mode 100644 (file)
index 0000000..c7e0732
--- /dev/null
@@ -0,0 +1,12 @@
+The poster.png file comes from https://github.com/w3c/web-platform-tests
+without any modification.
+
+This file is copyright by W3C and/or the author listed in the test
+file. The tests are dual-licensed under the W3C Test Suite License:
+http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
+and the BSD 3-clause License:
+http://www.w3.org/Consortium/Legal/2008/03-bsd-license
+under W3C's test suite licensing policy:
+http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright
+
+
diff --git a/tct-cors-w3c-tests/cors/support/cgi/cors_allow_origin_asterisk.php b/tct-cors-w3c-tests/cors/support/cgi/cors_allow_origin_asterisk.php
new file mode 100755 (executable)
index 0000000..9670254
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+#Copyright (c) 2013 Intel Corporation.
+#
+#Redistribution and use in source and binary forms, with or without modification,
+#are permitted provided that the following conditions are met:
+#
+#* Redistributions of works must retain the original copyright notice, this list
+#  of conditions and the following disclaimer.
+#* Redistributions in binary form must reproduce the original copyright notice,
+#  this list of conditions and the following disclaimer in the documentation
+#  and/or other materials provided with the distribution.
+#* Neither the name of Intel Corporation nor the names of its contributors
+#  may be used to endorse or promote products derived from this work without
+#  specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+#INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+#OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+#NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+#EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#Authors:
+#        Wang, Jing J <jing.j.wang@intel.com>
+
+echo "Server: Mongoose/1.3 (Linux)"
+echo "Access-Control-Allow-Origin: *"
+echo "Access-Control-Allow-Credentials: false"
+echo "Access-Control-Expose-Headers: Access-Control-Allow-Origin"
+echo "Cache-Control: no-cache"
+echo "Pragma: no-cache"
+echo "Content-Type: text/plain"
+echo
+echo -n "HelloWorld"
diff --git a/tct-cors-w3c-tests/cors/support/cgi/cors_credential_true.php b/tct-cors-w3c-tests/cors/support/cgi/cors_credential_true.php
new file mode 100755 (executable)
index 0000000..64ee18c
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+#Copyright (c) 2013 Intel Corporation.
+#
+#Redistribution and use in source and binary forms, with or without modification,
+#are permitted provided that the following conditions are met:
+#
+#* Redistributions of works must retain the original copyright notice, this list
+#  of conditions and the following disclaimer.
+#* Redistributions in binary form must reproduce the original copyright notice,
+#  this list of conditions and the following disclaimer in the documentation
+#  and/or other materials provided with the distribution.
+#* Neither the name of Intel Corporation nor the names of its contributors
+#  may be used to endorse or promote products derived from this work without
+#  specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+#INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+#OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+#NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+#EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#Authors:
+#        Wang, Jing J <jing.j.wang@intel.com>
+
+echo "Server: Mongoose/1.3 (Linux)"
+echo "Access-Control-Allow-Origin: $HTTP_ORIGIN"
+echo "Access-Control-Allow-Credentials: true"
+echo "Access-Control-Expose-Headers: Access-Control-Allow-Credentials"
+echo "Cache-Control: no-cache"
+echo "Pragma: no-cache"
+echo "Content-Type: text/plain"
+echo
+echo -n "HelloWorld"
diff --git a/tct-cors-w3c-tests/cors/support/cors_allow_origin_asterisk.php b/tct-cors-w3c-tests/cors/support/cors_allow_origin_asterisk.php
new file mode 100644 (file)
index 0000000..be20ed5
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+/*
+Copyright (c) 2012 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+  of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+  may be used to endorse or promote products derived from this work without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+        Fan,Weiwei <weiwix.fan@intel.com>
+
+*/
+    header("Access-Control-Allow-Origin: *"); // Specify domains from which requests are allowed
+    header("Access-Control-Allow-Credentials: false");
+    header("Access-Control-Expose-Headers: Access-Control-Allow-Origin");
+    header('Cache-Control: no-cache');
+    header('Pragma: no-cache');
+    header('Content-Type: text/plain');
+    $str = "HelloWorld";
+    echo($str);
+?>
diff --git a/tct-cors-w3c-tests/cors/support/cors_credential_true.php b/tct-cors-w3c-tests/cors/support/cors_credential_true.php
new file mode 100644 (file)
index 0000000..5582841
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+/*
+Copyright (c) 2012 Intel Corporation.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of works must retain the original copyright notice, this list
+  of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the original copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its contributors
+  may be used to endorse or promote products derived from this work without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Authors:
+        Fan,Weiwei <weiwix.fan@intel.com>
+
+*/
+    header("Access-Control-Allow-Origin: " . $_SERVER['HTTP_ORIGIN']); // Specify domains from which requests are allowed
+    header("Access-Control-Allow-Credentials: true");
+    header("Access-Control-Expose-Headers: Access-Control-Allow-Credentials");
+    header('Cache-Control: no-cache');
+    header('Pragma: no-cache');
+    header('Content-Type: text/plain');
+    $str = "HelloWorld";
+    echo($str);
+?>
diff --git a/tct-cors-w3c-tests/cors/support/poster.png b/tct-cors-w3c-tests/cors/support/poster.png
new file mode 100644 (file)
index 0000000..8d2493d
Binary files /dev/null and b/tct-cors-w3c-tests/cors/support/poster.png differ
index 376acf3bfe14d0b96aa99ca4f2f3cb1a5a7bacd3..bde357c2af412feac9cf0d59b376cbe4c67a29e2 100644 (file)
           </spec>
         </specs>
       </testcase>
+      <testcase purpose="Check if optionally add a single Access-Control-Max-Age header with as value the amount of seconds the user agent is allowed to cache the result of the request" type="compliance" status="approved" component="WebAPI/Security/Cross-Origin Resource Sharing" execution_type="auto" priority="P3" id="cors_XMLHttpRequest_add_max_age">
+        <description>
+          <steps>
+            <step order="1">
+              <step_desc>Check if optionally add a single Access-Control-Max-Age header with as value the amount of seconds the user agent is allowed to cache the result of the request</step_desc>
+              <expected>Pass</expected>
+            </step>
+          </steps>
+          <test_script_entry>http://127.0.0.1:8080/opt/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_add_max_age.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion usage="true" interface="XMLHttpRequest" specification="Cross-Origin Resource Sharing" section="Security" category="Tizen W3C API Specifications"/>
+            <spec_url>http://www.w3.org/TR/2012/WD-cors-20120403</spec_url>
+            <spec_statement>Optionally add a single Access-Control-Max-Age header with as value the amount of seconds the user agent is allowed to cache the result of the request</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check if the response uses the value of the Origin header as value, and adds a single Access-Control-Allow-Credentials header with the literal string 'true' as value when the resource supports credentials add a single Access-Control-Allow-Origin header" type="compliance" status="approved" component="WebAPI/Security/Cross-Origin Resource Sharing" execution_type="auto" priority="P3" id="cors_XMLHttpRequest_allow_credentials_true">
+        <description>
+          <steps>
+            <step order="1">
+              <step_desc>Check if the response uses the value of the Origin header as value, and adds a single Access-Control-Allow-Credentials header with the literal string 'true' as value when the resource supports credentials add a single Access-Control-Allow-Origin header</step_desc>
+              <expected>Pass</expected>
+            </step>
+          </steps>
+          <test_script_entry>http://127.0.0.1:8080/opt/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_allow_credentials_true.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion usage="true" interface="XMLHttpRequest" specification="Cross-Origin Resource Sharing" section="Security" category="Tizen W3C API Specifications"/>
+            <spec_url>http://www.w3.org/TR/2012/WD-cors-20120403</spec_url>
+            <spec_statement>If the resource supports credentials add a single Access-Control-Allow-Origin header, with the value of the Origin header as value, and add a single Access-Control-Allow-Credentials header with the literal string "true" as value</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check if the response adds a single Access-Control-Allow-Origin header and literal string '*' as value when the resource does not supports credentials add a single Access-Control-Allow-Origin header" type="compliance" status="approved" component="WebAPI/Security/Cross-Origin Resource Sharing" execution_type="auto" priority="P3" id="cors_XMLHttpRequest_credentials_false_origin">
+        <description>
+          <steps>
+            <step order="1">
+              <step_desc>Check if the response adds a single Access-Control-Allow-Origin header and literal string '*' as value when the resource does not supports credentials add a single Access-Control-Allow-Origin header</step_desc>
+              <expected>Pass</expected>
+            </step>
+          </steps>
+          <test_script_entry>http://127.0.0.1:8080/opt/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_credentials_false_origin.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion usage="true" interface="XMLHttpRequest" specification="Cross-Origin Resource Sharing" section="Security" category="Tizen W3C API Specifications"/>
+            <spec_url>http://www.w3.org/TR/2012/WD-cors-20120403</spec_url>
+            <spec_statement>Otherwise, add a single Access-Control-Allow-Origin header, with either the value of the Origin header or the literal string "*" as value</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check if the getResponseHeader() method of XMLHttpRequest will return valid value when the field name is an ASCII case-insensitive match for one of the values of the Access-Control-Expose-Headers headers" type="compliance" status="approved" component="WebAPI/Security/Cross-Origin Resource Sharing" execution_type="auto" priority="P3" id="cors_XMLHttpRequest_getResponseHeader_not_null">
+        <description>
+          <steps>
+            <step order="1">
+              <step_desc>Check if the getResponseHeader() method of XMLHttpRequest will return valid value when the field name is an ASCII case-insensitive match for one of the values of the Access-Control-Expose-Headers headers</step_desc>
+              <expected>Pass</expected>
+            </step>
+          </steps>
+          <test_script_entry>http://127.0.0.1:8080/opt/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_getResponseHeader_not_null.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion usage="true" interface="XMLHttpRequest" specification="Cross-Origin Resource Sharing" section="Security" category="Tizen W3C API Specifications"/>
+            <spec_url>http://www.w3.org/TR/2012/WD-cors-20120403</spec_url>
+            <spec_statement>User agents must filter out all response headers other than those that are a simple response header or of which the field name is an ASCII case-insensitive match for one of the values of the Access-Control-Expose-Headers headers (if any), before exposing response headers to APIs defined in CORS API specifications</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check if the getResponseHeader() method of XMLHttpRequest will return null when the field name does not match for one of the values of the Access-Control-Expose-Headers headers" type="compliance" status="approved" component="WebAPI/Security/Cross-Origin Resource Sharing" execution_type="auto" priority="P3" id="cors_XMLHttpRequest_getResponseHeader_null">
+        <description>
+          <steps>
+            <step order="1">
+              <step_desc>Check if the getResponseHeader() method of XMLHttpRequest will return null when the field name does not match for one of the values of the Access-Control-Expose-Headers headers</step_desc>
+              <expected>Pass</expected>
+            </step>
+          </steps>
+          <test_script_entry>http://127.0.0.1:8080/opt/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_getResponseHeader_null.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion usage="true" interface="XMLHttpRequest" specification="Cross-Origin Resource Sharing" section="Security" category="Tizen W3C API Specifications"/>
+            <spec_url>http://www.w3.org/TR/2012/WD-cors-20120403</spec_url>
+            <spec_statement>User agents must filter out all response headers other than those that are a simple response header or of which the field name is an ASCII case-insensitive match for one of the values of the Access-Control-Expose-Headers headers (if any), before exposing response headers to APIs defined in CORS API specifications</spec_statement>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check if the XMLHttpRequest supports CORS when the request method is get and async flag is true" type="compliance" status="approved" component="WebAPI/Security/Cross-Origin Resource Sharing" execution_type="auto" priority="P3" id="cors_XMLHttpRequest_get_true">
+        <description>
+          <pre_condition/>
+          <post_condition/>
+          <steps>
+            <step order="1">
+              <step_desc>when the test content was set in "request.open('get','http://example.com/hello',true);request.send();request.onreadystatechange();" format, it is shown like you can see now on the computer</step_desc>
+              <expected>All test results are marked "PASS"</expected>
+            </step>
+          </steps>
+          <test_script_entry timeout="6">http://127.0.0.1:8080/opt/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_get_true.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion usage="true" interface="XMLHttpRequest" specification="Cross-Origin Resource Sharing" section="Security" category="Tizen W3C API Specifications"/>
+            <spec_url>http://www.w3.org/TR/2012/WD-cors-20120403</spec_url>
+            <spec_statement/>
+          </spec>
+        </specs>
+      </testcase>
+      <testcase purpose="Check if the XMLHttpRequest supports CORS when the request method is post and async flag is true" type="compliance" status="approved" component="WebAPI/Security/Cross-Origin Resource Sharing" execution_type="auto" priority="P3" id="cors_XMLHttpRequest_post_true">
+        <description>
+          <pre_condition/>
+          <post_condition/>
+          <steps>
+            <step order="1">
+              <step_desc>when the test content was set in "request.open('post','http://unionplatform.com/xmlhttptest/echo.php'),true;request.send('message=test');request.onload();" format, it is shown like you can see now on the computer</step_desc>
+              <expected>All test results are marked "PASS"</expected>
+            </step>
+          </steps>
+          <test_script_entry timeout="6">http://127.0.0.1:8080/opt/tct-cors-w3c-tests/cors/cors_XMLHttpRequest_post_true.html</test_script_entry>
+        </description>
+        <specs>
+          <spec>
+            <spec_assertion usage="true" interface="XMLHttpRequest" specification="Cross-Origin Resource Sharing" section="Security" category="Tizen W3C API Specifications"/>
+            <spec_url>http://www.w3.org/TR/2012/WD-cors-20120403</spec_url>
+            <spec_statement/>
+          </spec>
+        </specs>
+      </testcase>
     </set>
   </suite>
 </test_definition>