/* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; // Test that resolution is restored to its pre-RDM value after closing RDM. // Do this by using a chrome-only method to force resolution before opening // RDM, then letting RDM set its own preferred resolution due to the meta // viewport settings. When we close RDM and check resolution, we check for // something close to what we initially set, bracketed by these scaling // factors: const RESOLUTION_FACTOR_MIN = 0.96; const RESOLUTION_FACTOR_MAX = 1.04; info("--- Starting viewport test output ---"); const WIDTH = 200; const HEIGHT = 200; const TESTS = [ { content: "width=600" }, { content: "width=600, initial-scale=1.0", res_restore: 0.782 }, { content: "width=device-width", res_restore: 3.4 }, { content: "width=device-width, initial-scale=2.0", res_restore: 1.1 }, ]; for (const { content, res_restore } of TESTS) { const TEST_URL = `data:text/html;charset=utf-8,` + `
` + `