5 <title>meta viewport test
</title>
6 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
8 <script src=
"viewport_helpers.js"></script>
11 <p>No
<meta
name=
"viewport"> tag
</p>
12 <script type=
"application/javascript">
15 add_task(async function test1() {
16 await SpecialPowers.pushPrefEnv(scaleRatio(
1.0));
18 let info = getViewportInfo(
800,
480);
19 fuzzeq(info.defaultZoom,
0.25,
"initial scale is clamped to the default mimumim scale");
20 fuzzeq(info.minZoom,
0.25,
"minimum scale defaults to the absolute minimum");
21 is(info.maxZoom,
10,
"maximum scale defaults to the absolute maximum");
22 is(info.width,
980,
"width is the default width");
23 is(info.height,
588,
"height is proportional to displayHeight");
24 is(info.autoSize, false,
"autoSize is disabled by default");
25 is(info.allowZoom, true,
"zooming is enabled by default");
27 info = getViewportInfo(
490,
600);
28 is(info.width,
980,
"width is still the default width");
29 is(info.height,
1200,
"height is proportional to the new displayHeight");
32 add_task(async function test2() {
33 await SpecialPowers.pushPrefEnv(scaleRatio(
1.5));
35 let info = getViewportInfo(
800,
480);
36 is(info.width,
980,
"width is still the default width");
37 is(info.height,
588,
"height is still proportional to displayHeight");