Skip to content

Commit

Permalink
Merge db99588 into 8d7a169
Browse files Browse the repository at this point in the history
  • Loading branch information
nebojsasandin authored Mar 9, 2024
2 parents 8d7a169 + db99588 commit 1aeeb9b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CefSharp.Test/OffScreen/OffScreenBrowserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,29 @@ public async Task ShouldWorkWhenLoadingGoogle()
}
}

[Fact]
public async Task GoogleSearchToGoogleAccountsBreaksJS()
{
using (var browser = new ChromiumWebBrowser("www.google.com", useLegacyRenderHandler: false))
{
var response = await browser.WaitForInitialLoadAsync();

browser.Load("https://accounts.google.com/");
var nav = await browser.WaitForNavigationAsync();
var mainFrame = browser.GetMainFrame();

Assert.True(nav.Success);
Assert.True(mainFrame.IsValid);
Assert.Contains("accounts.google", mainFrame.Url);
Assert.Equal(200, nav.HttpStatusCode);

output.WriteLine("Url {0}", mainFrame.Url);

var buttonText = await mainFrame.EvaluateScriptAsync<string>("(function() { return document.querySelector(\"button[aria-haspopup='menu']\").innerText; })();");
Assert.Equal("Create account", buttonText);
}
}

[Theory]
[InlineData("http://httpbin.org/post")]
public async Task ShouldWorkWhenLoadingRequestWithPostData(string url)
Expand Down

0 comments on commit 1aeeb9b

Please sign in to comment.