OLD | NEW |
1 function setWindowSizeOverride(width, height) { | 1 function setWindowSizeOverride(width, height) { |
2 if (window.internals) | 2 if (window.internals) |
3 window.internals.settings.setTextAutosizingWindowSizeOverride(width, hei
ght); | 3 window.internals.settings.setTextAutosizingWindowSizeOverride(width, hei
ght); |
4 } | 4 } |
5 | 5 |
6 function setFontScaleFactor(scale) { | 6 function setFontScaleFactor(scale) { |
7 if (window.internals) | 7 if (window.internals) |
8 window.internals.settings.setAccessibilityFontScaleFactor(scale); | 8 window.internals.settings.setAccessibilityFontScaleFactor(scale); |
9 } | 9 } |
10 | 10 |
11 function initAutosizingTest() { | 11 function initAutosizingTest() { |
12 if (window.internals) { | 12 if (window.internals) { |
13 window.internals.settings.setTextAutosizingEnabled(true); | 13 window.internals.settings.setTextAutosizingEnabled(true); |
14 setWindowSizeOverride(320, 480); | 14 setWindowSizeOverride(320, 480); |
15 } else if (window.console && console.warn) { | 15 } else if (window.console && console.warn) { |
16 console.warn("This test depends on Text Autosizing being enabled. Run wi
th content shell" | 16 console.warn("This test depends on Text Autosizing being enabled. Run wi
th content shell" |
17 + "and --dump-render-tree or manually enable Text Autosizing and
either use a " | 17 + "and --dump-render-tree or manually enable Text Autosizing and
either use a " |
18 + "mobile device with 320px device-width (like Nexus S or iPhone
), or define " | 18 + "mobile device with 320px device-width (like Nexus S or iPhone
), or define " |
19 + "HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP."); | 19 + "DEBUG_TEXT_AUTOSIZING_ON_DESKTOP."); |
20 } | 20 } |
21 } | 21 } |
22 | 22 |
23 // Automatically call init. Users who want a different window size can use setWi
ndowSizeOverride. | 23 // Automatically call init. Users who want a different window size can use setWi
ndowSizeOverride. |
24 initAutosizingTest(); | 24 initAutosizingTest(); |
OLD | NEW |