tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / fast / css / device-aspect-ratio.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head id="myhead">
4 <script src="../js/resources/js-test-pre.js"></script>
5 <script>
6 if (window.layoutTestController) {
7     window.layoutTestController.waitUntilDone();
8 }
9
10 var count = 0;
11 var maxCount = 10;
12 var timeout = 100;
13
14 function doTest()
15 {
16     var headElement = document.getElementById("myhead");
17     var linkElement = document.createElement("link");
18     linkElement.rel = "stylesheet";
19     linkElement.media = "screen and (device-aspect-ratio: " + screen.width + "/" + screen.height + ")";
20     linkElement.href = "resources/device-aspect-ratio.css";
21     headElement.appendChild(linkElement);
22     description("This text is green if the device-aspect-ratio media query works properly.");
23     setTimeout("waitForStylesheetLoad()", timeout);
24 }
25
26 function waitForStylesheetLoad()
27 {
28     count++;
29
30     if (document.defaultView.getComputedStyle(document.getElementById('description'), null).color == "rgb(0, 128, 0)") {
31         shouldBe("document.defaultView.getComputedStyle(document.getElementById('description'), null).color", "'rgb(0, 128, 0)'");
32         isSuccessfullyParsed();
33         if (window.layoutTestController) {
34             window.layoutTestController.notifyDone();
35         }
36         return;
37     }
38
39     if (count > maxCount) {
40         testFailed("Stylesheet did not load in " + (maxCount * timeout / 1000) + " second(s).");
41         return;
42     }
43
44     setTimeout("waitForStylesheetLoad()", timeout);
45 }
46 </script>
47 </head>
48 <body onload="doTest()">
49 </body>
50 </html>