[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / media / print-restores-previous-mediatype.html
1 <html>
2 <head>
3 <title>Test that print restores previous media type</title>
4 <style type="text/css">
5
6 </style>
7 <script type="text/javascript" charset="utf-8">
8     if (window.layoutTestController) {
9         layoutTestController.dumpAsText();
10         layoutTestController.setMediaType("handheld");
11     }
12
13     function log(m)
14     {
15         var results = document.getElementById('results');
16         results.innerHTML += m + '<br>';
17     }
18
19     function shouldBe(aDescription, a, b)
20     {
21         if (a === b) {
22             log("PASS: " + aDescription + " should be '" + b + "' and is.");
23         } else {
24             log("FAIL: " + aDescription + " should be '" + b + "' but instead is '" + a + "'.");
25         }
26     }
27
28     function runTests()
29     {
30         log("Media type is set to 'handheld' to be different than the default 'screen'");
31         shouldBe("window.styleMedia.type", window.styleMedia.type, "handheld");
32         log("<br>The page is printed, which changes the media type to 'print', and then back");
33         window.print();
34         shouldBe("window.styleMedia.type", window.styleMedia.type, "handheld");
35     }
36 </script>
37 </head>
38 <body onload="runTests()">
39     <div id="results"></div>
40 </body>
41 </html>