Skip to content

Commit 6940d59

Browse files
authored
Implement AppMode tests (#340)
1 parent 6574f23 commit 6940d59

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Net;
6+
using System.Threading.Tasks;
7+
using Xunit;
8+
using Xunit.Abstractions;
9+
10+
namespace PuppeteerSharp.Tests.PuppeteerTests
11+
{
12+
[Collection("PuppeteerLoaderFixture collection")]
13+
public class AppModeTests : PuppeteerBaseTest
14+
{
15+
public AppModeTests(ITestOutputHelper output) : base(output) { }
16+
17+
[Fact]
18+
public async Task ShouldWork()
19+
{
20+
var options = TestConstants.DefaultBrowserOptions();
21+
options.AppMode = true;
22+
23+
using (var browser = await Puppeteer.LaunchAsync(options, TestConstants.ChromiumRevision, TestConstants.LoggerFactory))
24+
using (var page = await browser.NewPageAsync())
25+
{
26+
Assert.Equal(121, await page.EvaluateExpressionAsync<int>("11 * 11"));
27+
}
28+
}
29+
}
30+
}

lib/PuppeteerSharp/LaunchOptions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ public class LaunchOptions : IBrowserOptions
1616
/// <summary>
1717
/// If set to true, sets Headless = false, otherwise, enables automation.
1818
/// </summary>
19+
/// <remarks>
20+
/// AppMode won't neither add the argument '--remote-debugging-pipe' nor implement Pipes
21+
/// due to limitations in .NET see <see href="https://github.com/dotnet/corefx/issues/30575"/>
22+
/// </remarks>
1923
public bool AppMode { get; set; }
2024

2125
/// <summary>
@@ -73,4 +77,4 @@ public class LaunchOptions : IBrowserOptions
7377
/// </summary>
7478
public bool LogProcess { get; set; }
7579
}
76-
}
80+
}

0 commit comments

Comments
 (0)