Skip to content

Commit 559246a

Browse files
authored
Merge pull request #281 from MicrosoftEdge/smoketest/1.0.3477-testing
Smoketest/1.0.3477 testing
2 parents ff6beb5 + 277443a commit 559246a

File tree

9 files changed

+37
-50
lines changed

9 files changed

+37
-50
lines changed

SampleApps/WebView2APISample/AppWindow.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2317,7 +2317,8 @@ void AppWindow::RegisterEventHandlers()
23172317
}
23182318
else
23192319
{
2320-
newAppWindow = new AppWindow(m_creationModeId, GetWebViewOption(), L"none");
2320+
newAppWindow = new AppWindow(
2321+
m_creationModeId, GetWebViewOption(), L"none", m_userDataFolder);
23212322
}
23222323
newAppWindow->m_isPopupWindow = true;
23232324
newAppWindow->m_onWebViewFirstInitialized = [args, deferral, newAppWindow]()

SampleApps/WebView2APISample/DropTarget.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
#include "DropTarget.h"
88
#include "ViewComponent.h"
99
#include <ShlGuid.h>
10-
#include <Shobjidl.h>
10+
#include <shobjidl.h>
1111

12-
DropTarget::DropTarget() : m_window(nullptr) {}
12+
DropTarget::DropTarget() : m_window(nullptr)
13+
{
14+
}
1315

1416
DropTarget::~DropTarget()
1517
{

SampleApps/WebView2APISample/ScenarioServiceWorkerManager.cpp

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ void ScenarioServiceWorkerManager::GetAllServiceWorkerRegistrations()
171171
HRESULT error, ICoreWebView2ExperimentalServiceWorkerRegistrationCollectionView*
172172
workerRegistrationCollection) -> HRESULT
173173
{
174+
CHECK_FAILURE(error);
174175
UINT32 workersCount = 0;
175176
CHECK_FAILURE(workerRegistrationCollection->get_Count(&workersCount));
176177

@@ -217,10 +218,11 @@ void ScenarioServiceWorkerManager::GetServiceWorkerRegisteredForScope()
217218

218219
if (dialog.confirmed)
219220
{
221+
std::wstring scope = dialog.input.c_str();
220222
CHECK_FAILURE(m_serviceWorkerManager->GetServiceWorkerRegistrationsForScope(
221-
dialog.input.c_str(),
223+
scope.c_str(),
222224
Callback<ICoreWebView2ExperimentalGetServiceWorkerRegistrationsCompletedHandler>(
223-
[this](
225+
[this, scope](
224226
HRESULT error,
225227
ICoreWebView2ExperimentalServiceWorkerRegistrationCollectionView*
226228
workerRegistrationCollection) -> HRESULT
@@ -230,52 +232,34 @@ void ScenarioServiceWorkerManager::GetServiceWorkerRegisteredForScope()
230232
CHECK_FAILURE(workerRegistrationCollection->get_Count(&workersCount));
231233

232234
std::wstringstream message{};
233-
message << L"Number of service workers registered for the given scope: "
234-
<< workersCount << std::endl;
235+
message << L"Number of service workers registered for the scope ("
236+
<< scope.c_str() << ") : " << workersCount << std::endl;
235237

236238
for (UINT32 i = 0; i < workersCount; i++)
237239
{
238-
Microsoft::WRL::ComPtr<
239-
ICoreWebView2ExperimentalServiceWorkerRegistration>
240+
ComPtr<ICoreWebView2ExperimentalServiceWorkerRegistration>
240241
serviceWorkerRegistration;
241242
CHECK_FAILURE(workerRegistrationCollection->GetValueAtIndex(
242243
i, &serviceWorkerRegistration));
243244

244-
wil::com_ptr<ICoreWebView2ExperimentalServiceWorker> serviceWorker;
245+
wil::unique_cotaskmem_string scopeUri;
246+
CHECK_FAILURE(serviceWorkerRegistration->get_ScopeUri(&scopeUri));
247+
248+
wil::unique_cotaskmem_string origin;
249+
CHECK_FAILURE(serviceWorkerRegistration->get_Origin(&origin));
250+
251+
wil::unique_cotaskmem_string topLevelOrigin;
245252
CHECK_FAILURE(
246-
serviceWorkerRegistration->get_ActiveServiceWorker(&serviceWorker));
247-
248-
if (serviceWorker)
249-
{
250-
// Log that the service worker is activated.
251-
}
252-
else
253-
{
254-
CHECK_FAILURE(serviceWorkerRegistration->add_ServiceWorkerActivated(
255-
Callback<
256-
ICoreWebView2ExperimentalServiceWorkerActivatedEventHandler>(
257-
[this](
258-
ICoreWebView2ExperimentalServiceWorkerRegistration*
259-
sender,
260-
ICoreWebView2ExperimentalServiceWorkerActivatedEventArgs*
261-
args) -> HRESULT
262-
{
263-
wil::com_ptr<ICoreWebView2ExperimentalServiceWorker>
264-
serviceWorker;
265-
CHECK_FAILURE(
266-
args->get_ActiveServiceWorker(&serviceWorker));
267-
268-
// Log that the service worker is activated.
269-
m_appWindow->AsyncMessageBox(
270-
L"Service worker is activated", L"Service worker");
271-
272-
return S_OK;
273-
})
274-
.Get(),
275-
nullptr));
276-
}
253+
serviceWorkerRegistration->get_TopLevelOrigin(&topLevelOrigin));
254+
255+
message << L"ScopeUri: " << scopeUri.get() << std::endl;
256+
message << L"Origin: " << origin.get() << std::endl;
257+
message << L"TopLevelOrigin: " << topLevelOrigin.get() << std::endl;
277258
}
278259

260+
m_appWindow->AsyncMessageBox(
261+
std::move(message.str()), L"Registered service workers for scope");
262+
279263
return S_OK;
280264
})
281265
.Get()));

SampleApps/WebView2APISample/WebView2APISample.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ BEGIN
312312
BEGIN
313313
MENUITEM "Listen to new Service Worker Registrations", IDM_SCENARIO_SERVICE_WORKER_REGISTRATION_REQUESTED
314314
MENUITEM "Get Service Worker Registrations", IDM_SCENARIO_GET_SERVICE_WORKER_REGISTRATIONS
315-
MENUITEM "Get Service Worker registered for the Scope", IDM_SCENARIO_GET_SERVICE_WORKER_REGISTERED_FOR_SCOPE
315+
MENUITEM "Get Service Worker Registrations for the Scope", IDM_SCENARIO_GET_SERVICE_WORKER_REGISTERED_FOR_SCOPE
316316
MENUITEM "Web Messaging", IDM_SCENARIO_SERVICE_WORKER_POST_MESSAGE
317317
END
318318
POPUP "Dedicated Worker"

SampleApps/WebView2APISample/WebView2APISample.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,13 +517,13 @@
517517
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
518518
<ImportGroup Label="ExtensionTargets">
519519
<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')" />
520-
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.3415-prerelease\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.3415-prerelease\build\native\Microsoft.Web.WebView2.targets')" />
520+
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.3477-prerelease\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.3477-prerelease\build\native\Microsoft.Web.WebView2.targets')" />
521521
</ImportGroup>
522522
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
523523
<PropertyGroup>
524524
<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>
525525
</PropertyGroup>
526526
<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'))" />
527-
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.3415-prerelease\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.3415-prerelease\build\native\Microsoft.Web.WebView2.targets'))" />
527+
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.3477-prerelease\build\native\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.3477-prerelease\build\native\Microsoft.Web.WebView2.targets'))" />
528528
</Target>
529529
</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.3415-prerelease" targetFramework="native" />
3+
<package id="Microsoft.Web.WebView2" version="1.0.3477-prerelease" targetFramework="native" />
44
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220201.1" targetFramework="native" />
55
</packages>

SampleApps/WebView2APISample/targetver.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
#pragma once
66

7-
// Including SDKDDKVer.h defines the highest available Windows platform.
7+
// Including sdkddkver.h defines the highest available Windows platform.
88

99
// If you wish to build your application for a previous Windows platform,
1010
// include WinSDKVer.h and set the _WIN32_WINNT macro to the platform you wish
11-
// to support before including SDKDDKVer.h.
11+
// to support before including sdkddkver.h.
1212

13-
#include <SDKDDKVer.h>
13+
#include <sdkddkver.h>

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.3415-prerelease" />
28+
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3477-prerelease" />
2929
</ItemGroup>
3030
<ItemGroup>
3131
<Folder Include="assets\" />

SampleApps/WebView2WpfBrowser/WebView2WpfBrowser.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
</Content>
6262
</ItemGroup>
6363
<ItemGroup>
64-
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3415-prerelease" />
64+
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3477-prerelease" />
6565
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
6666
</ItemGroup>
6767
</Project>

0 commit comments

Comments
 (0)