From 6e191610151ae89f2d984a9ed97a43cd57a3ec87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Kondratiuk?= Date: Sat, 9 Mar 2019 12:36:03 -0300 Subject: [PATCH] Add failing for test for mobile + cross process navigation (#997) --- .../InputTests/InputTests.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/PuppeteerSharp.Tests/InputTests/InputTests.cs b/lib/PuppeteerSharp.Tests/InputTests/InputTests.cs index 59196d9c1..88190e8eb 100644 --- a/lib/PuppeteerSharp.Tests/InputTests/InputTests.cs +++ b/lib/PuppeteerSharp.Tests/InputTests/InputTests.cs @@ -552,6 +552,32 @@ public async Task ShouldTweenMouseMovement() }, await Page.EvaluateExpressionAsync("result")); } + [Fact(Skip = "see https://crbug.com/929806")] + public async Task ShouldWorkWithMobileViewportsAndCrossProcessNavigations() + { + await Page.GoToAsync(TestConstants.EmptyPage); + await Page.SetViewportAsync(new ViewPortOptions + { + Width = 360, + Height = 640, + IsMobile = true + }); + await Page.GoToAsync(TestConstants.CrossProcessUrl + "/mobile.html"); + await Page.EvaluateFunctionAsync(@"() => { + document.addEventListener('click', event => { + window.result = { x: event.clientX, y: event.clientY }; + }); + }"); + + await Page.Mouse.ClickAsync(30, 40); + + Assert.Equal(new DomPointInternal() + { + X = 30, + Y = 40 + }, await Page.EvaluateExpressionAsync("result")); + } + [Fact] public async Task ShouldTapTheButton() {