OLD | NEW |
(Empty) | |
| 1 (async function(testRunner) { |
| 2 let {page, session, dp} = await testRunner.startBlank(` |
| 3 Tests that device emulation affects media rules, viewport meta tag, body dim
ensions and window.screen. |
| 4 Emulating small device on a page with viewport "width=device-width" set shou
ld work without reload for page without scrollbar. |
| 5 `); |
| 6 |
| 7 var DeviceEmulator = await testRunner.loadScript('../resources/device-emulator
.js'); |
| 8 var deviceEmulator = new DeviceEmulator(testRunner, session); |
| 9 await deviceEmulator.emulate(380, 420, 1); |
| 10 |
| 11 var viewport = 'w=dw'; |
| 12 testRunner.log(`Loading page with viewport=${viewport}`); |
| 13 await session.navigate('../resources/device-emulation.html?' + viewport); |
| 14 await session.evaluate(`document.body.classList.add('small')`); |
| 15 |
| 16 testRunner.log(await session.evaluate(`dumpMetrics(true)`)); |
| 17 testRunner.completeTest(); |
| 18 }) |
OLD | NEW |