- add third_party src.
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / forms / input-type-change3.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10 description('Tests for writing and reading .type property of HTMLInputElement.');
11
12 var input = document.createElement('input');
13 document.body.appendChild(input);
14
15 // The default type is "text".
16 shouldBe('input.type', '"text"');
17
18 function check(value, expected)
19 {
20     input.type = value;
21     if (input.type == expected)
22         testPassed('input.type for "' + value + '" is correctly "' + input.type + '".');
23     else
24         testFailed('input.type for "' + value + '" is incorrectly "' + input.type + '", should be "' + expected + '".');
25 }
26
27 // The type is not specified explicitly.  We can change it to "file".
28 check("file", "file");
29 // http://webkit.org/b/57343
30 check("file", "file");
31 check("FILE", "file");
32
33 check("text", "text");
34 check("TEXT", "text");  // input.type must return a lower case value according to DOM Level 2.
35 check(" text ", "text");
36 check("button", "button");
37 check(" button ", "text");
38 check("checkbox", "checkbox");
39 check("email", "email");
40 check("file", "email"); // We can't change a concrete type to file for a security reason.
41 check("hidden", "hidden");
42 check("image", "image");
43 check("isindex", "text");
44 check("number", "number");
45 check("password", "password");
46 check("passwd", "text");
47 check("radio", "radio");
48 check("range", "range");
49 check("reset", "reset");
50 check("search", "search");
51 check("submit", "submit");
52 check("tel", "tel");
53 check("telephone", "text");
54 check("url", "url");
55 check("uri", "text");
56
57 </script>
58 </body>
59 </html>