Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sdks
diff options
context:
space:
mode:
authorLarry Ewing <lewing@microsoft.com>2019-12-21 02:42:50 +0300
committerLarry Ewing <lewing@microsoft.com>2020-01-03 04:28:18 +0300
commit14a3add47f059ddd69a6f2a4e6d20d391e7c7017 (patch)
treee999fc901f3950aaa4f7c6746f995453ff2cb339 /sdks
parent11bf192d1a0de3ac9b48a3a26b0c5acc9b906d38 (diff)
[wasm][debugger] put the testharness base url in one place
Diffstat (limited to 'sdks')
-rw-r--r--sdks/wasm/DebuggerTestSuite/Support.cs8
-rw-r--r--sdks/wasm/ProxyDriver/Program.cs11
-rw-r--r--sdks/wasm/ProxyDriver/TestHarnessStartup.cs3
3 files changed, 10 insertions, 12 deletions
diff --git a/sdks/wasm/DebuggerTestSuite/Support.cs b/sdks/wasm/DebuggerTestSuite/Support.cs
index c56f013e145..106fbe85d72 100644
--- a/sdks/wasm/DebuggerTestSuite/Support.cs
+++ b/sdks/wasm/DebuggerTestSuite/Support.cs
@@ -60,13 +60,13 @@ namespace DebuggerTests
await eventListeners[method](args, token);
}
- public async Task Ready (Func<InspectorClient, CancellationToken, Task> cb = null) {
+ public async Task Ready (Func<InspectorClient, CancellationToken, Task> cb = null, TimeSpan? span = null) {
using (var cts = new CancellationTokenSource ()) {
- cts.CancelAfter (60 * 1000); //tests have 1 minute to complete
- var uri = new Uri ("ws://localhost:9300/launch-chrome-and-connect");
+ cts.CancelAfter (span?.Milliseconds ?? 60 * 1000); //tests have 1 minute to complete by default
+ var uri = new Uri ($"ws://{TestHarnessProxy.Endpoint.Authority}/launch-chrome-and-connect");
using (var client = new InspectorClient ()) {
await client.Connect (uri, OnMessage, async token => {
- Task[] init_cmds = new Task [] {
+ Task[] init_cmds = {
client.SendCommand ("Profiler.enable", null, token),
client.SendCommand ("Runtime.enable", null, token),
client.SendCommand ("Debugger.enable", null, token),
diff --git a/sdks/wasm/ProxyDriver/Program.cs b/sdks/wasm/ProxyDriver/Program.cs
index 65204607227..9224670ee5c 100644
--- a/sdks/wasm/ProxyDriver/Program.cs
+++ b/sdks/wasm/ProxyDriver/Program.cs
@@ -32,24 +32,21 @@ namespace WsProxy
{
config.AddCommandLine(args);
})
- .UseDebugProxy ()
+ .UseUrls ("http://localhost:9300")
.Build ();
host.Run ();
}
}
- public static class MonoProxyExtensions {
- public static IWebHostBuilder UseDebugProxy (this IWebHostBuilder host) =>
- host.UseUrls ("http://localhost:9300");
- }
-
public class TestHarnessProxy {
static IWebHost host;
static Task hostTask;
static CancellationTokenSource cts = new CancellationTokenSource ();
static object proxyLock = new object ();
+ public static readonly Uri Endpoint = new Uri ("http://localhost:9400");
+
public static Task Start (string chromePath, string appPath, string pagePath)
{
lock (proxyLock) {
@@ -68,7 +65,7 @@ namespace WsProxy
})
.UseKestrel ()
.UseStartup<TestHarnessStartup> ()
- .UseDebugProxy ()
+ .UseUrls (Endpoint.ToString ())
.Build();
hostTask = host.StartAsync (cts.Token);
}
diff --git a/sdks/wasm/ProxyDriver/TestHarnessStartup.cs b/sdks/wasm/ProxyDriver/TestHarnessStartup.cs
index 325781d9cb3..9b91dbc7bf6 100644
--- a/sdks/wasm/ProxyDriver/TestHarnessStartup.cs
+++ b/sdks/wasm/ProxyDriver/TestHarnessStartup.cs
@@ -142,7 +142,8 @@ namespace WsProxy {
var devToolsUrl = options.DevToolsUrl;
var psi = new ProcessStartInfo ();
- psi.Arguments = $"--headless --disable-gpu --remote-debugging-port={devToolsUrl.Port} http://localhost:9300/{options.PagePath}";
+
+ psi.Arguments = $"--headless --disable-gpu --remote-debugging-port={devToolsUrl.Port} http://{TestHarnessProxy.Endpoint.Authority}/{options.PagePath}";
psi.UseShellExecute = false;
psi.FileName = options.ChromePath;
psi.RedirectStandardError = true;