<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>maximum-scale=0.5 in meta viewport</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <meta name="viewport" content="maximum-scale=0.5">
  <script src="viewport_helpers.js"></script>
</head>
<body>
  <p>maximum-scale=0.5</p>
  <script type="application/javascript">
    "use strict";

    add_task(async function maximum_scale_0_5() {
      await SpecialPowers.pushPrefEnv(scaleRatio(1.0));

      let info = getViewportInfo(800, 480);
      // In the case where the maximum-scale is less than 1 and there is no
      // initial-scale or initial-scale is NOT greater than the maximum-scale,
      // 'min-width' will be bigger than the display width.
      is(info.width, 1600, "width should be scaled by 1 / maximum-scale");
      is(info.height, 960, "height should be scaled by 1 / maximum-scale");
      is(info.maxZoom, 0.5, "maximum-scale should be 0.5");
    });
  </script>
</body>
</html>
