Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue29233.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Controls.TestCases.HostApp.Issues.Issue29233"
Title="Issue29233">
<VerticalStackLayout VerticalOptions="Center">
<Label AutomationId="WaitLabel" x:Name="waitLabel" />
<Label IsVisible="false" AutomationId="MauiLabel" x:Name="label" />
<WebView Navigated="WebView_Navigated"/>
</VerticalStackLayout>
</ContentPage>
25 changes: 25 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue29233.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Threading.Tasks;

namespace Controls.TestCases.HostApp.Issues;

[Issue(IssueTracker.Github, 29233, "Android WebView Navigated is fired without setting source", PlatformAffected.Android)]
public partial class Issue29233 : ContentPage
{
public Issue29233()
{
InitializeComponent();
}

private void WebView_Navigated(object sender, WebNavigatedEventArgs e)
{
label.IsVisible = true;
label.Text= "Failed";
}

protected override async void OnAppearing()
{
base.OnAppearing();
await Task.Delay(2000);
waitLabel.Text = "Hello";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Tests.Issues;

public class Issue29233 : _IssuesUITest
{
public Issue29233(TestDevice device) : base(device)
{
}

public override string Issue => "Android WebView Navigated is fired without setting source";

[Test]
[Category(UITestCategories.WebView)]
public void NavigatedShouldNotFireWithNullSource()
{
App.WaitForElement("WaitLabel",timeout: TimeSpan.FromSeconds(5));
App.WaitForNoElement("MauiLabel");
}
}
2 changes: 0 additions & 2 deletions src/Core/src/Platform/Android/WebViewExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public static void UpdateSource(this AWebView platformWebView, IWebView webView,
platformWebView.UpdateCanGoBackForward(webView);
}
}
else
platformWebView.LoadUrl("about:blank");
}

public static void UpdateSettings(this AWebView platformWebView, IWebView webView, bool javaScriptEnabled, bool domStorageEnabled)
Expand Down
Loading