Skip to content

Commit

Permalink
Increase CookieParam.Expires size (hardkoded#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
kblok authored Jun 26, 2018
1 parent 6940d59 commit 73cce69
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions lib/PuppeteerSharp.Tests/Issues/Issue0343.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using System.Linq;

namespace PuppeteerSharp.Tests.Issues
{
[Collection("PuppeteerLoaderFixture collection")]
public class Issue0343 : PuppeteerPageBaseTest
{
public Issue0343(ITestOutputHelper output) : base(output)
{
}

[Fact]
public async Task ShouldSupportLongExpiresValueInCookies()
{
await Page.GoToAsync(TestConstants.EmptyPage);
var longExpiresValue = 3677410981.1125112d;
await Page.SetCookieAsync(new CookieParam
{
Name = "password",
Value = "123456",
Expires = longExpiresValue
});
var cookies = await Page.GetCookiesAsync();
Assert.Equal(longExpiresValue, cookies.First(c => c.Name == "password").Expires);
}
}
}
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp/CookieParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class CookieParam
/// </summary>
/// <value>Expiration.</value>
[JsonProperty("expires", NullValueHandling = NullValueHandling.Ignore)]
public int? Expires { get; set; }
public double? Expires { get; set; }
/// <summary>
/// Gets or sets the size.
/// </summary>
Expand Down

0 comments on commit 73cce69

Please sign in to comment.