Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smoketest/1.0.2783 testing #253

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Changes from 1 commit
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
Next Next commit
Updates for Win32, WPF, WinForms, UWP and WinUI3 sample apps from 129…
….0.2783.0
WebView2GithubBot committed Aug 20, 2024
commit abbb1845d6b1194da81a953d6d2ebc789789f614
4 changes: 2 additions & 2 deletions SampleApps/WebView2APISample/WebView2APISample.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
@@ -489,4 +489,4 @@
<Error Condition="!Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.2730-prerelease\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.2730-prerelease\build\native\Microsoft.Web.WebView2.targets'))" />
</Target>
</Project>
</Project>
24 changes: 20 additions & 4 deletions SampleApps/WebView2APISample/documentation/Testing-Instructions.md
Original file line number Diff line number Diff line change
@@ -1448,12 +1448,10 @@ this the `appRegion` changes would not take place until some document element wa
1. Right click 'Microsoft Edge WebView2' element and select `restore`
1. Expected: Sample app will restore.

#### Interactive Dragging
#### Interactive Dragging Enabled By Default

Test that interactive dragging works on Webview2.
Test that interactive dragging is enabled by default on Webview2.

1. Run the application with the following flag
--edge-webview-interactive-dragging.
1. Click Scenario > Non-Client Region Support.
1. Look under the Heading "Interactive Elements".
1. Hover the mouse on the textarea and button.
@@ -1468,6 +1466,24 @@ Test that interactive dragging works on Webview2.
1. Click button.
1. Expected: The click counter should increment.

#### Interactive Dragging Opt-out

Test that the interactive dragging opt-out switch works on Webview2.

1. run the app with the flag
--edge-webview-disable-interactive-dragging
1. Click Scenario > Non-Client Region Support.
1. Look under the Heading "Interactive Elements".
1. Hover the mouse on the textarea and button.
1. Expected: Cursor should be arrow, the element border should
stay the same.
1. Drag on text area and button.
1. Expected: The entire app should drag.
1. Click into text area.
1. Expected: Cursor remains the same.
1. Click button.
1. Expected: The click counter should not increment.

#### Drag and Drop

Test that Drag and Drop is supported in WebView2 using both hosting modes.
39 changes: 22 additions & 17 deletions SampleApps/WebView2WindowsFormsBrowser/BrowserForm.cs
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
using Microsoft.Web.WebView2.Core;
using Microsoft.Web.WebView2.WinForms;
using System.Linq;
using System.ComponentModel;

namespace WebView2WindowsFormsBrowser
{
@@ -1448,25 +1449,29 @@ private string GetAppPath()

private string GetRuntimePath(CoreWebView2 webView2)
{
int processId = (int)webView2.BrowserProcessId;
try
{
Process process = System.Diagnostics.Process.GetProcessById(processId);
var fileName = process.MainModule.FileName;
return System.IO.Path.GetDirectoryName(fileName);
}
catch (ArgumentException e)
{
Trace.WriteLine(e.Message);
}
catch (SystemException e)
{
Trace.WriteLine(e.Message);
}
return "";
int processId = (int)webView2.BrowserProcessId;
try
{
Process process = System.Diagnostics.Process.GetProcessById(processId);
var fileName = process.MainModule.FileName;
return System.IO.Path.GetDirectoryName(fileName);
}
catch (ArgumentException e)
{
return e.Message;
}
catch (InvalidOperationException e)
{
return e.Message;
}
// Occurred when a 32-bit process wants to access the modules of a 64-bit process.
catch (Win32Exception e)
{
return e.Message;
}
}

private string GetStartPageUri(CoreWebView2 webView2)
private string GetStartPageUri(CoreWebView2 webView2)
{
string uri = "https://appassets.example/AppStartPage.html";
if (webView2 == null)
1 change: 0 additions & 1 deletion SampleApps/WebView2WpfBrowser/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -107,7 +107,6 @@ found in the LICENSE file.
<CommandBinding Command="{x:Static local:MainWindow.FileExplorerCommand}" Executed="FileExplorerExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.ToggleScreenCaptureEnableCommand}" Executed="TogglScreenCaptureEnabledCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
<CommandBinding Command="{x:Static local:MainWindow.FileTypePolicyCommand}" Executed="FileTypePolicyExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>

</Window.CommandBindings>
<DockPanel>
<Menu DockPanel.Dock="Top">
32 changes: 31 additions & 1 deletion SampleApps/WebView2WpfBrowser/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data.Common;
using System.Diagnostics;
using System.IO;
using System.Linq;
@@ -127,6 +128,13 @@ public partial class MainWindow : Window
public static RoutedCommand ToggleScreenCaptureEnableCommand = new RoutedCommand();
public static RoutedCommand FileTypePolicyCommand = new RoutedCommand();

public static RoutedCommand ServiceWorkerRegisteredCommand = new RoutedCommand();
public static RoutedCommand GetServiceWorkerRegistrationsCommand = new RoutedCommand();
public static RoutedCommand GetServiceWorkerRegisteredForScopeCommand = new RoutedCommand();
public static RoutedCommand DedicatedWorkerCreatedCommand = new RoutedCommand();
public static RoutedCommand SharedWorkerManagerCommand = new RoutedCommand();
public static RoutedCommand GetSharedWorkersCommand = new RoutedCommand();

#endregion commands

bool _isNavigating = false;
@@ -3718,5 +3726,27 @@ void WebView_FileTypePolicy_DOMContentLoaded(object sender, CoreWebView2DOMConte
}
#endif

void DedicatedWorkerCreatedExecuted(object target, ExecutedRoutedEventArgs e)
{
}
void ServiceWorkerRegisteredExecuted(object target, ExecutedRoutedEventArgs e)
{
}
private async void GetServiceWorkerRegistrationsExecuted(object target, ExecutedRoutedEventArgs e)
{
await Task.Delay(0);
}

async void GetServiceWorkerRegisteredForScopeExecuted(object target, ExecutedRoutedEventArgs e)
{
await Task.Delay(0);
}
void SharedWorkerManagerExecuted(object target, ExecutedRoutedEventArgs e)
{
}
private async void GetSharedWorkersExecuted(object target, ExecutedRoutedEventArgs e)
{
await Task.Delay(0);
}
}
}
}