Skip to content

Commit

Permalink
Roll Chromium to r656675 (#1124)
Browse files Browse the repository at this point in the history
* Roll Chromium to r654752

* Roll Chromium to r656675
  • Loading branch information
kblok authored May 17, 2019
1 parent f16a7ee commit 432bbbe
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public async Task ShouldWork()
Assert.Equal(new[] { "hello", "world" }, values);
}

[Fact(Skip = "See https://github.com/GoogleChrome/puppeteer/issues/4263")]
public async Task ShouldWorkForNonBlankPage()
{
// Instantiate an object
Expand Down
11 changes: 6 additions & 5 deletions lib/PuppeteerSharp.Tests/FrameTests/WaitForNavigationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@ await Task.WhenAll(
}

[Fact]
public async Task ShouldResolveWhenFrameDetaches()
public async Task ShouldFailWhenFrameDetaches()
{
await Page.GoToAsync(TestConstants.ServerUrl + "/frames/one-frame.html");
var frame = Page.FirstChildFrame();
Server.SetRoute("/empty.html", context => Task.Delay(10000));
var waitForNavigationResult = frame.WaitForNavigationAsync();
await Task.WhenAll(
Server.WaitForRequest("/empty.html"),
frame.EvaluateFunctionAsync($"() => window.location = '{TestConstants.EmptyPage}'"));
Server.WaitForRequest("/empty.html"),
frame.EvaluateFunctionAsync($"() => window.location = '{TestConstants.EmptyPage}'"));

await Page.QuerySelectorAsync("iframe").EvaluateFunctionAsync("frame => frame.remove()");
var response = await waitForNavigationResult;
await Page.QuerySelectorAsync("iframe").EvaluateFunctionAsync("frame => frame.remove()");
var exception = await Assert.ThrowsAsync<PuppeteerException>(() => waitForNavigationResult);
Assert.Equal("Navigating frame was detached", exception.Message);
}
}
}
4 changes: 1 addition & 3 deletions lib/PuppeteerSharp.Tests/PageTests/EvaluateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ public async Task ShouldThrowWhenEvaluationTriggersReload()
{
return Page.EvaluateFunctionAsync(@"() => {
location.reload();
return new Promise(resolve => {
setTimeout(() => resolve(1), 0);
});
return new Promise(() => {});
}");
});

Expand Down
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp/BrowserFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class BrowserFetcher
/// <summary>
/// Default Chromium revision.
/// </summary>
public const int DefaultRevision = 650583;
public const int DefaultRevision = 656675;

/// <summary>
/// Gets the downloads folder.
Expand Down
5 changes: 5 additions & 0 deletions lib/PuppeteerSharp/CookieParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,10 @@ public class CookieParam
/// <value>Whether it's session only or not.</value>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public bool? Session { get; set; }
/// <summary>
/// Gets or sets the cookies SameSite value.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public SameSite? SameSite { get; set; }
}
}
29 changes: 29 additions & 0 deletions lib/PuppeteerSharp/SameSite.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Newtonsoft.Json;
using PuppeteerSharp.Helpers.Json;

namespace PuppeteerSharp
{
/// <summary>
/// SameSite values in cookies
/// </summary>
[JsonConverter(typeof(FlexibleStringEnumConverter), None)]
public enum SameSite
{
/// <summary>
/// None
/// </summary>
None,
/// <summary>
/// Strict
/// </summary>
Strict,
/// <summary>
/// Lax
/// </summary>
Lax,
/// <summary>
/// Extended
/// </summary>
Extended
}
}

0 comments on commit 432bbbe

Please sign in to comment.