提交 cb2b321f 编写于 作者: M Martin Zikmund

chore: Further test adjustments

上级 0b526e70
......@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.UI.Xaml.Controls;
using Microsoft.Web.WebView2.Core;
using Private.Infrastructure;
using Windows.UI.Xaml.Controls;
......@@ -30,7 +31,7 @@ public class Given_WebView2
webView.NavigationCompleted += (s, e) => navigationDone = true;
webView.CoreWebView2.Navigate(uri.ToString());
Assert.IsNull(webView.Source);
await TestServices.WindowHelper.WaitFor(() => navigationDone);
await TestServices.WindowHelper.WaitFor(() => navigationDone, 3000);
Assert.IsNotNull(webView.Source);
Assert.IsTrue(webView.Source.OriginalString.StartsWith("https://example.com/", StringComparison.OrdinalIgnoreCase));
}
......@@ -51,11 +52,12 @@ public class Given_WebView2
webView.NavigationCompleted += (s, e) => navigationDone = true;
webView.Source = uri;
Assert.IsNotNull(webView.Source);
await TestServices.WindowHelper.WaitFor(() => navigationDone, 2000);
await TestServices.WindowHelper.WaitFor(() => navigationDone, 3000);
Assert.IsNotNull(webView.Source);
navigationDone = false;
webView.NavigateToString("<html></html>");
Assert.IsTrue(webView.Source.OriginalString.StartsWith("https://example.com/", StringComparison.OrdinalIgnoreCase));
Assert.IsTrue(webView.CoreWebView2.Source.StartsWith("https://example.com/", StringComparison.OrdinalIgnoreCase));
await TestServices.WindowHelper.WaitFor(() => navigationDone, 3000);
Assert.AreEqual(CoreWebView2.BlankUri, webView.Source);
}
[TestMethod]
......
......@@ -74,7 +74,7 @@ public class Given_WebView
}
[TestMethod]
public async Task When_ExecuteScriptAsync_String()
public async Task When_InvokeScriptAsync_String()
{
var border = new Border();
var webView = new WebView();
......@@ -94,7 +94,7 @@ public class Given_WebView
}
[TestMethod]
public async Task When_ExecuteScriptAsync_Non_String()
public async Task When_InvokeScriptAsync_Non_String()
{
var border = new Border();
var webView = new WebView();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册