Index: third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-emulation-small-dw.js |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-emulation-small-dw.js b/third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-emulation-small-dw.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..70d7270d974632e7904d62d66dc4e5a2bc7fad51 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-emulation-small-dw.js |
@@ -0,0 +1,18 @@ |
+(async function(testRunner) { |
+ let {page, session, dp} = await testRunner.startBlank(` |
+ Tests that device emulation affects media rules, viewport meta tag, body dimensions and window.screen. |
+ Emulating small device on a page with viewport "width=device-width" set should work without reload for page without scrollbar. |
+ `); |
+ |
+ var DeviceEmulator = await testRunner.loadScript('../resources/device-emulator.js'); |
+ var deviceEmulator = new DeviceEmulator(testRunner, session); |
+ await deviceEmulator.emulate(380, 420, 1); |
+ |
+ var viewport = 'w=dw'; |
+ testRunner.log(`Loading page with viewport=${viewport}`); |
+ await session.navigate('../resources/device-emulation.html?' + viewport); |
+ await session.evaluate(`document.body.classList.add('small')`); |
+ |
+ testRunner.log(await session.evaluate(`dumpMetrics(true)`)); |
+ testRunner.completeTest(); |
+}) |