Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / text-autosizing / resources / autosizingTest.js
blobf0e30d186590f3529c09b05b4583418a619866dd
1 function setWindowSizeOverride(width, height) {
2     if (window.internals)
3         window.internals.settings.setTextAutosizingWindowSizeOverride(width, height);
6 function setFontScaleFactor(scale) {
7     if (window.internals)
8         window.internals.settings.setAccessibilityFontScaleFactor(scale);
11 function initAutosizingTest() {
12     if (window.internals) {
13         window.internals.settings.setTextAutosizingEnabled(true);
14         setWindowSizeOverride(320, 480);
15     } else if (window.console && console.warn) {
16         console.warn("This test depends on Text Autosizing being enabled. Run with content shell "
17                 + "and --run-layout-test or manually enable Text Autosizing and either use a "
18                 + "mobile device with 320px device-width (like Nexus S or iPhone), or define "
19                 + "DEBUG_TEXT_AUTOSIZING_ON_DESKTOP.");
20     }
23 // Automatically call init. Users who want a different window size can use setWindowSizeOverride.
24 initAutosizingTest();