Updated icon.png and config.xml for all widget related file in WRT TCs
[test/tct/web/wrt.git] / tct-ext02-wrt-tests / style-src_unsafe_inline / index.html
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2012 Intel Corporation.
4
5 Redistribution and use in source and binary forms, with or without modification,
6 are permitted provided that the following conditions are met:
7
8 * Redistributions of works must retain the original copyright notice, this list
9   of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the original copyright notice,
11   this list of conditions and the following disclaimer in the documentation
12   and/or other materials provided with the distribution.
13 * Neither the name of Intel Corporation nor the names of its contributors
14   may be used to endorse or promote products derived from this work without
15   specific prior written permission.
16
17 THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
21 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 Authors:
29         Yue, Ma <yuex.ma@intel.com>
30
31 -->
32
33 <html>
34   <head>
35     <title>Test: style-src_unsafe_inline</title>
36     <link rel="author" title="Intel" href="http://www.intel.com"/>
37     <link rel="help" href="http://www.w3.org/TR/2012/CR-CSP-20121115/#style-src"/>
38     <meta name="flags" content=""/>
39     <meta name="assert" content="default-src *;style-src 'unsafe-inline'"/>
40     <meta charset="utf-8">
41     <link rel="stylesheet" type="text/css" href="http://127.0.0.1:8081/opt/tct-ext02-wrt-tests/w3c/support/canvas-index.css"/>
42     <link rel="stylesheet" type="text/css" href="support/blue-100x100.css"/>
43     <style>
44       #test-green {
45         background-color: green;
46         height: 100px;
47         width: 100px;
48       }
49     </style>
50   </head>
51   <body>
52     <p>Test passes if there is a "PASS" under a green square.</p>
53     <div id="test-blue"></div>
54     <div id="test-green"></div>
55     <h3 id="h3"></h3>
56     <script language="javascript" type="text/javascript">
57         var h3 = document.querySelector("h3");
58         var display = getComputedStyle(h3)["display"];
59         var display_h3 = display != "inline" ? true : false;
60         var test_blue = document.querySelector("#test-blue");
61         var color_blue = getComputedStyle(test_blue)["backgroundColor"];
62         var blue = color_blue != "rgb(0, 0, 255)" ? true : false;
63         var test_green = document.querySelector("#test-green");
64         var color_green = getComputedStyle(test_green)["backgroundColor"];
65         var green = color_green == "rgb(0, 128, 0)" ? true : false;
66         if(display_h3 && blue && green) {
67             document.getElementById("h3").innerText = "PASS";
68         } else {
69             document.getElementById("h3").innerText = "FAIL";
70         }
71     </script>
72   </body>
73 </html>