Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/emulation/device-emulation-initial-scale.js

Issue 2960023003: [DevTools] Migrate inspector-protocol/emulation tests to new harness (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 (async function(testRunner) {
2 let {page, session, dp} = await testRunner.startBlank(`
3 Tests that turning on device emulation with a non-1 device pixel ratio sets the
4 appropriate initial scale. Page scale is reflected by the innerWidth and
5 innerHeight properties. Since the layout width is set to 980 (in the viewpor t
6 meta tag), and the emulated viewport width is 490 px, the initial scale shou ld
7 be 490/980 = 0.5. i.e. innerWidth=980 innerHeight=640.`);
8
9 var DeviceEmulator = await testRunner.loadScript('../resources/device-emulator .js');
10 var deviceEmulator = new DeviceEmulator(testRunner, session);
11 // 980px viewport loaded into a 490x320 screen should load at 0.5 scale.
12 await deviceEmulator.emulate(490, 320, 3);
13
14 var viewport = 'w=980';
15 testRunner.log(`Loading page with viewport=${viewport}`);
16 await session.navigate('../resources/device-emulation.html?' + viewport);
17
18 testRunner.log(await session.evaluate(`dumpMetrics(true)`));
19 testRunner.completeTest();
20 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698