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
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
4 changes: 2 additions & 2 deletions SampleApps/WebView2APISample/WebView2APISample.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -480,13 +480,13 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.2730-prerelease\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.2730-prerelease\build\native\Microsoft.Web.WebView2.targets')" />
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.2783-prerelease\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.2783-prerelease\build\native\Microsoft.Web.WebView2.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<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'))" />
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.2783-prerelease\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.2783-prerelease\build\native\Microsoft.Web.WebView2.targets'))" />
</Target>
</Project>
24 changes: 20 additions & 4 deletions SampleApps/WebView2APISample/documentation/Testing-Instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion SampleApps/WebView2APISample/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Web.WebView2" version="1.0.2730-prerelease" targetFramework="native" />
<package id="Microsoft.Web.WebView2" version="1.0.2783-prerelease" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220201.1" targetFramework="native" />
</packages>
39 changes: 22 additions & 17 deletions SampleApps/WebView2WindowsFormsBrowser/BrowserForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Microsoft.Web.WebView2.Core;
using Microsoft.Web.WebView2.WinForms;
using System.Linq;
using System.ComponentModel;

namespace WebView2WindowsFormsBrowser
{
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2730-prerelease" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2783-prerelease" />
</ItemGroup>
<ItemGroup>
<Folder Include="assets\" />
Expand Down
1 change: 0 additions & 1 deletion SampleApps/WebView2WpfBrowser/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
32 changes: 31 additions & 1 deletion SampleApps/WebView2WpfBrowser/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
}
}
2 changes: 1 addition & 1 deletion SampleApps/WebView2WpfBrowser/WebView2WpfBrowser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2730-prerelease" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2783-prerelease" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
</Project>
Loading