|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <head> |
|
4 <meta charset="utf-8"> |
|
5 <title>meta viewport test</title> |
|
6 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
8 <meta name="viewport" content="user-scalable=NO"> |
|
9 <script src="viewport_helpers.js"></script> |
|
10 </head> |
|
11 <body> |
|
12 <p>user-scalable=NO</p> |
|
13 <script type="application/javascript;version=1.7"> |
|
14 "use strict"; |
|
15 |
|
16 SimpleTest.waitForExplicitFinish(); |
|
17 |
|
18 let tests = []; |
|
19 |
|
20 tests.push(function test1() { |
|
21 let info = getViewportInfo(800, 480); |
|
22 is(info.allowZoom, true, "user-scalable values are case-sensitive; 'NO' is not valid"); |
|
23 |
|
24 nextTest(); |
|
25 }); |
|
26 |
|
27 function getViewportInfo(aDisplayWidth, aDisplayHeight) { |
|
28 let defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom = {}, |
|
29 width = {}, height = {}, autoSize = {}; |
|
30 |
|
31 let cwu = SpecialPowers.getDOMWindowUtils(window); |
|
32 cwu.getViewportInfo(aDisplayWidth, aDisplayHeight, defaultZoom, allowZoom, |
|
33 minZoom, maxZoom, width, height, autoSize); |
|
34 return { |
|
35 defaultZoom: defaultZoom.value, |
|
36 minZoom: minZoom.value, |
|
37 maxZoom: maxZoom.value, |
|
38 width: width.value, |
|
39 height: height.value, |
|
40 autoSize: autoSize.value, |
|
41 allowZoom: allowZoom.value |
|
42 }; |
|
43 } |
|
44 |
|
45 function nextTest() { |
|
46 if (tests.length) |
|
47 (tests.shift())(); |
|
48 else |
|
49 SimpleTest.finish(); |
|
50 } |
|
51 addEventListener("load", nextTest); |
|
52 </script> |
|
53 </body> |
|
54 </html> |