refactor: simplify EmulationManager (#2816)

EmualationManager used to be injecting touch hooks to properly
support touch emulation.

However, these are no longer necessary, since https://crbug.com/133915
is long fixed.
This commit is contained in:
Andrey Lushnikov
2018-06-28 18:48:44 -07:00
committed by GitHub
parent c4acc63775
commit 871b204fd1
5 changed files with 16 additions and 36 deletions

View File

@@ -1276,6 +1276,11 @@ module.exports.addTests = function({testRunner, expect, puppeteer, DeviceDescrip
await page.goto(server.PREFIX + '/detect-touch.html');
expect(await page.evaluate(() => document.body.textContent.trim())).toBe('YES');
});
it('should detect touch when applying viewport with touches', async({page, server}) => {
await page.setViewport({ width: 800, height: 600, hasTouch: true });
await page.addScriptTag({url: server.PREFIX + '/modernizr.js'});
expect(await page.evaluate(() => Modernizr.touchevents)).toBe(true);
});
it('should support landscape emulation', async({page, server}) => {
await page.goto(server.PREFIX + '/mobile.html');
expect(await page.evaluate(() => screen.orientation.type)).toBe('portrait-primary');