Skip to content

Commit a6a092b

Browse files
Merge pull request #301 from MicrosoftEdge/smoketest/1.0.4312-testing
Smoketest/1.0.4312 testing
2 parents bd0048f + 42c9dde commit a6a092b

9 files changed

Lines changed: 346 additions & 13 deletions

File tree

‎SampleApps/WebView2APISample/ProcessComponent.cpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ ProcessComponent::ProcessComponent(AppWindow* appWindow)
125125
//! [CrashReport]
126126
// Query for the crash report (available when Crashpad handled
127127
// the crash; nullptr for __fastfail / WER-only crashes).
128-
auto experimentalArgs2 =
129-
args.try_query<ICoreWebView2ExperimentalProcessFailedEventArgs2>();
130-
if (experimentalArgs2)
128+
auto processFailedArgs4 =
129+
args.try_query<ICoreWebView2ProcessFailedEventArgs4>();
130+
if (processFailedArgs4)
131131
{
132-
wil::com_ptr<ICoreWebView2ExperimentalCrashReport> crashReport;
133-
CHECK_FAILURE(experimentalArgs2->get_CrashReport(&crashReport));
132+
wil::com_ptr<ICoreWebView2CrashReport> crashReport;
133+
CHECK_FAILURE(processFailedArgs4->get_CrashReport(&crashReport));
134134
if (crashReport)
135135
{
136136
wil::unique_cotaskmem_string crashReportId;

‎SampleApps/WebView2APISample/WebView2APISample.vcxproj‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,13 +540,13 @@
540540
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
541541
<ImportGroup Label="ExtensionTargets">
542542
<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')" />
543-
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.4255-prerelease\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.4255-prerelease\build\native\Microsoft.Web.WebView2.targets')" />
543+
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.4312-prerelease\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.4312-prerelease\build\native\Microsoft.Web.WebView2.targets')" />
544544
</ImportGroup>
545545
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
546546
<PropertyGroup>
547547
<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>
548548
</PropertyGroup>
549549
<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'))" />
550-
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.4255-prerelease\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.4255-prerelease\build\native\Microsoft.Web.WebView2.targets'))" />
550+
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.4312-prerelease\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.4312-prerelease\build\native\Microsoft.Web.WebView2.targets'))" />
551551
</Target>
552552
</Project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.Web.WebView2" version="1.0.4255-prerelease" targetFramework="native" />
3+
<package id="Microsoft.Web.WebView2" version="1.0.4312-prerelease" targetFramework="native" />
44
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220201.1" targetFramework="native" />
55
</packages>

‎SampleApps/WebView2WindowsFormsBrowser/WebView2WindowsFormsBrowser.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<PlatformTarget>AnyCPU</PlatformTarget>
2626
</PropertyGroup>
2727
<ItemGroup>
28-
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.4255-prerelease" />
28+
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.4312-prerelease" />
2929
</ItemGroup>
3030
<ItemGroup>
3131
<Folder Include="assets\" />
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<Window x:Class="WebView2WpfBrowser.ClusterEnvironmentDialog"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:WebView2WpfBrowser"
7+
mc:Ignorable="d"
8+
Title="Shared Cluster Environment"
9+
SizeToContent="Height"
10+
Width="440"
11+
WindowStartupLocation="CenterOwner">
12+
<StackPanel Margin="12">
13+
<TextBlock TextWrapping="Wrap" Margin="0,0,0,10"
14+
Text="Hosts that pass the same ClusterName and the same options share a single browser process. The first host to create the cluster pins these options; a later host that asks for a different set gets an options mismatch."/>
15+
16+
<TextBlock x:Name="ClusterNameLabel" Text="ClusterName"/>
17+
<TextBox x:Name="ClusterNameInput" Margin="0,2,0,8"
18+
AutomationProperties.LabeledBy="{Binding ElementName=ClusterNameLabel}"/>
19+
20+
<TextBlock x:Name="LanguageLabel" Text="Language"/>
21+
<TextBox x:Name="LanguageInput" Margin="0,2,0,8"
22+
AutomationProperties.LabeledBy="{Binding ElementName=LanguageLabel}"/>
23+
24+
<TextBlock x:Name="BrowserArgsLabel" Text="AdditionalBrowserArguments"/>
25+
<TextBox x:Name="BrowserArgsInput" Margin="0,2,0,8"
26+
AutomationProperties.LabeledBy="{Binding ElementName=BrowserArgsLabel}"/>
27+
28+
<TextBlock Text="Options" Margin="0,4,0,2"/>
29+
<CheckBox x:Name="SingleSignOnInput" Content="AllowSingleSignOnUsingOSPrimaryAccount" Margin="0,2"/>
30+
<CheckBox x:Name="TrackingPreventionInput" Content="EnableTrackingPrevention" Margin="0,2"/>
31+
<CheckBox x:Name="BrowserExtensionsInput" Content="AreBrowserExtensionsEnabled" Margin="0,2"/>
32+
<CheckBox x:Name="ProfileIsolationInput" Content="PerHostProfileIsolation" Margin="0,2,0,8"/>
33+
34+
<TextBlock Text="ReleaseChannels" Margin="0,4,0,2"/>
35+
<StackPanel Orientation="Horizontal" Margin="0,0,0,8"
36+
AutomationProperties.Name="ReleaseChannels">
37+
<CheckBox x:Name="StableInput" Content="Stable" Margin="0,0,12,0"/>
38+
<CheckBox x:Name="BetaInput" Content="Beta" Margin="0,0,12,0"/>
39+
<CheckBox x:Name="DevInput" Content="Dev" Margin="0,0,12,0"/>
40+
<CheckBox x:Name="CanaryInput" Content="Canary"/>
41+
</StackPanel>
42+
43+
<TextBlock x:Name="SearchKindLabel" Text="ChannelSearchKind"/>
44+
<ComboBox x:Name="SearchKindInput" Margin="0,2,0,12"
45+
AutomationProperties.LabeledBy="{Binding ElementName=SearchKindLabel}">
46+
<ComboBoxItem Content="MostStable"/>
47+
<ComboBoxItem Content="LeastStable"/>
48+
</ComboBox>
49+
50+
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
51+
<Button Click="ok_Clicked" IsDefault="True" Width="80" Margin="0,0,8,0">OK</Button>
52+
<Button IsCancel="True" Width="80">Cancel</Button>
53+
</StackPanel>
54+
</StackPanel>
55+
</Window>
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
using System.Windows;
2+
3+
namespace WebView2WpfBrowser
4+
{
5+
/// <summary>
6+
/// Collects the options used to create or join a shared cluster environment.
7+
///
8+
/// Exposes only plain CLR types rather than
9+
/// CoreWebView2ClusterEnvironmentOptions, because those are experimental
10+
/// APIs absent from the stable package, so naming them here would fail the
11+
/// Stable configuration with CS0246. MainWindow converts inside its
12+
/// USE_WEBVIEW2_EXPERIMENTAL block.
13+
///
14+
/// The defaults match the Win32 WebView2APISample so both samples pin an
15+
/// identical option set and can join each other's clusters.
16+
/// </summary>
17+
public partial class ClusterEnvironmentDialog : Window
18+
{
19+
public ClusterEnvironmentDialog(string defaultClusterName)
20+
{
21+
InitializeComponent();
22+
23+
ClusterNameInput.Text = defaultClusterName;
24+
LanguageInput.Text = string.Empty;
25+
BrowserArgsInput.Text = string.Empty;
26+
27+
SingleSignOnInput.IsChecked = false;
28+
TrackingPreventionInput.IsChecked = true;
29+
BrowserExtensionsInput.IsChecked = false;
30+
ProfileIsolationInput.IsChecked = true;
31+
32+
StableInput.IsChecked = true;
33+
BetaInput.IsChecked = true;
34+
DevInput.IsChecked = true;
35+
CanaryInput.IsChecked = true;
36+
37+
// LeastStable so the loader prefers a Canary/Dev channel install over
38+
// the stable Evergreen runtime, which predates the cluster feature.
39+
SearchKindInput.SelectedIndex = 1;
40+
41+
ClusterNameInput.Focus();
42+
ClusterNameInput.SelectAll();
43+
}
44+
45+
// Trimmed because the cluster name becomes a folder name: the loader
46+
// rejects control characters and a trailing space or dot.
47+
public string ClusterName => ClusterNameInput.Text.Trim();
48+
49+
// Named ClusterLanguage rather than Language because FrameworkElement
50+
// already defines a Language property, and the sample builds with
51+
// TreatWarningsAsErrors so CS0108 would fail the build.
52+
public string ClusterLanguage => LanguageInput.Text.Trim();
53+
54+
public string AdditionalBrowserArguments => BrowserArgsInput.Text.Trim();
55+
56+
public bool AllowSingleSignOnUsingOSPrimaryAccount => SingleSignOnInput.IsChecked == true;
57+
58+
public bool EnableTrackingPrevention => TrackingPreventionInput.IsChecked == true;
59+
60+
public bool AreBrowserExtensionsEnabled => BrowserExtensionsInput.IsChecked == true;
61+
62+
public bool PerHostProfileIsolation => ProfileIsolationInput.IsChecked == true;
63+
64+
public bool StableChannel => StableInput.IsChecked == true;
65+
66+
public bool BetaChannel => BetaInput.IsChecked == true;
67+
68+
public bool DevChannel => DevInput.IsChecked == true;
69+
70+
public bool CanaryChannel => CanaryInput.IsChecked == true;
71+
72+
/// <summary>
73+
/// 0 = MostStable, 1 = LeastStable. Matches the values of
74+
/// CoreWebView2ChannelSearchKind without naming the experimental enum.
75+
/// </summary>
76+
public int ChannelSearchKindIndex => SearchKindInput.SelectedIndex;
77+
78+
void ok_Clicked(object sender, RoutedEventArgs args)
79+
{
80+
if (string.IsNullOrWhiteSpace(ClusterNameInput.Text))
81+
{
82+
MessageBox.Show(this, "ClusterName is required.", "Shared Cluster Environment");
83+
// Put the caret back in the field that needs fixing, rather
84+
// than leaving a keyboard or screen reader user to find it.
85+
ClusterNameInput.Focus();
86+
ClusterNameInput.SelectAll();
87+
return;
88+
}
89+
DialogResult = true;
90+
}
91+
}
92+
}

‎SampleApps/WebView2WpfBrowser/MainWindow.xaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ found in the LICENSE file.
5252
<CommandBinding Command="{x:Static local:MainWindow.NewBrowserVersionCommand}" Executed="NewBrowserVersionCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
5353
<CommandBinding Command="{x:Static local:MainWindow.SwipeNavigationCommand}" Executed="SwipeNavigationCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
5454
<!-- #if USE_WEBVIEW2_EXPERIMENTAL -->
55+
<CommandBinding Command="{x:Static local:MainWindow.ClusterEnvironmentCreateOrJoinCommand}" Executed="ClusterEnvironmentCreateOrJoinExecuted"/>
56+
<CommandBinding Command="{x:Static local:MainWindow.ClusterEnvironmentGetOptionsCommand}" Executed="ClusterEnvironmentGetOptionsExecuted"/>
5557
<CommandBinding Command="{x:Static local:MainWindow.SetOriginFeaturesCommand}" Executed="SetOriginFeaturesCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
5658
<CommandBinding Command="{x:Static local:MainWindow.GetEffectiveFeaturesForOriginCommand}" Executed="GetEffectiveFeaturesForOriginCmdExecuted" CanExecute="CoreWebView2RequiringCmdsCanExecute"/>
5759
<!-- #endif -->
@@ -176,6 +178,12 @@ found in the LICENSE file.
176178
<MenuItem Header="_New Window" Command="ApplicationCommands.New"/>
177179
<MenuItem Header="_New Window With Options" Command="{x:Static local:MainWindow.NewWindowWithOptionsCommand}"/>
178180
<MenuItem Header="_Create New Thread" Command="{x:Static local:MainWindow.CreateNewThreadCommand}"/>
181+
<!-- #if USE_WEBVIEW2_EXPERIMENTAL -->
182+
<MenuItem Header="Shared _Cluster Environment">
183+
<MenuItem Header="_Create or Join Cluster" Command="{x:Static local:MainWindow.ClusterEnvironmentCreateOrJoinCommand}"/>
184+
<MenuItem Header="_Get Cluster Options" Command="{x:Static local:MainWindow.ClusterEnvironmentGetOptionsCommand}"/>
185+
</MenuItem>
186+
<!-- #endif -->
179187
<!---TODO-->
180188
</MenuItem>
181189
<MenuItem Header="_Process">

0 commit comments

Comments
 (0)