tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / xmlhttprequest / xmlhttprequest-get.xhtml
1 <?xml version="1.0"?>
2 <!-- 
3    - The contents of this file are subject to the Mozilla Public
4    - License Version 1.1 (the "License"); you may not use this file
5    - except in compliance with the License. You may obtain a copy of
6    - the License at http://www.mozilla.org/MPL/
7    - 
8    - Software distributed under the License is distributed on an "AS
9    - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10    - implied. See the License for the specific language governing
11    - rights and limitations under the License.
12    - 
13    - The Original Code is Mozilla Test Cases.
14    - 
15    - The Initial Developer of the Original Code is Netscape Communications
16    - Corp.  Portions created by Netscape Communications Corp. are 
17    - Copyright (C) 2001 Netscape Communications Corp.  All
18    - Rights Reserved.
19    - 
20    - Contributor(s): 
21   -->
22 <html xmlns="http://www.w3.org/1999/xhtml">
23 <head>
24 <title>GET test</title>
25 <style type="text/css">
26 .box {
27   display: box;
28   border: 1px solid black;
29   margin-bottom: 0.5em;
30 }
31 .boxheader {
32   font-weight: bold;
33   color: maroon;
34 }
35 pre {
36   margin-left: 2em;
37 }
38 </style>
39 <script type="text/javascript">
40 var p = new XMLHttpRequest();
41
42 if (window.layoutTestController) {
43   layoutTestController.dumpAsText();
44   layoutTestController.waitUntilDone();
45 }
46
47 function myfunc(e)
48 {
49   document.getElementById("id1").firstChild.nodeValue = p.responseText;
50   if (p.responseXML) {
51     var s = new XMLSerializer();
52     var d = p.responseXML;
53     var str = s.serializeToString(d);
54     document.getElementById("id2").firstChild.nodeValue = str;
55   }
56   document.getElementById("id3").firstChild.nodeValue = p.getAllResponseHeaders();
57   document.getElementById("id4").firstChild.nodeValue = p.status;
58   document.getElementById("id5").firstChild.nodeValue = p.statusText;
59   document.getElementById("id6").firstChild.nodeValue = p.readyState;
60   var propNames = new Array;
61   for (prop in e) {
62     if (prop != "timeStamp") {
63         propNames.push(prop);
64     }
65   }
66   propNames.sort();
67   var eventProperties = "";
68   for (i in propNames) {
69         var prop = propNames[i];
70         eventProperties += prop + " : '" + e[prop] + "'\n";
71   }
72   
73   document.getElementById("id7").firstChild.nodeValue = 
74     "Event object: " + e + "\n" +
75     "Event properties:\n" + eventProperties;
76
77   if (window.layoutTestController)
78     layoutTestController.notifyDone();
79 }
80
81 p.onload = myfunc;
82 p.open("GET", "resources/xmlhttprequest-get-data.xml");
83
84 function mysend()
85 {
86   p.send(null);
87 }
88 </script>
89 </head>
90 <body onload="mysend();">
91 <h1>GET test</h1>
92
93 <div class="box"><span class="boxheader">responseText</span>
94 <pre id="id1">@@No result@@</pre>
95 </div>
96 <div class="box"><span class="boxheader">responseXML serialized</span>
97 <pre id="id2">@@No result@@</pre>
98 </div>
99 <div class="box"><span class="boxheader">getAllResponseHeaders()</span>
100 <pre id="id3">@@No result@@</pre>
101 </div>
102 <div class="box"><span class="boxheader">status</span>
103 <pre id="id4">@@No result@@</pre>
104 </div>
105 <div class="box"><span class="boxheader">statusText</span>
106 <pre id="id5">@@No result@@</pre>
107 </div>
108 <div class="box"><span class="boxheader">readyState</span>
109 <pre id="id6">@@No result@@</pre>
110 </div>
111 <div class="box"><span class="boxheader">Event information</span>
112 <pre id="id7">@@No result@@</pre>
113 </div>
114
115 </body>
116 </html>