Title: [262291] trunk/Source/WebCore
- Revision
- 262291
- Author
- [email protected]
- Date
- 2020-05-29 06:18:06 -0700 (Fri, 29 May 2020)
Log Message
[WebXR] WebXRSystem::unregisterSimulatedXRDeviceForTesting() ASSERTs in m_immersiveDevices.contains(device)
https://bugs.webkit.org/show_bug.cgi?id=212516
Reviewed by Žan Doberšek.
The ASSERT that was failing was wrong. It was assuming that every simulated device should be part of the list
of immersive devices. That's wrong, as devices only supporting inline sessions are not in that list.
Apart from that, fake devices were not removed from the list of available devices in WebXRTest after
disconnecting them all. That could potentially cause flakiness in the tests.
No new test required as the current tests were properly detecting the issue.
* Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Use XRSessionMode directly.
(WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Fixed the ASSERT. A simulated device
might not be in the list of immersive devices if only supports inline sessions.
* testing/WebXRTest.cpp:
(WebCore::WebXRTest::disconnectAllDevices): Clear the list of devices after disconnecting.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (262290 => 262291)
--- trunk/Source/WebCore/ChangeLog 2020-05-29 12:47:12 UTC (rev 262290)
+++ trunk/Source/WebCore/ChangeLog 2020-05-29 13:18:06 UTC (rev 262291)
@@ -1,3 +1,25 @@
+2020-05-29 Sergio Villar Senin <[email protected]>
+
+ [WebXR] WebXRSystem::unregisterSimulatedXRDeviceForTesting() ASSERTs in m_immersiveDevices.contains(device)
+ https://bugs.webkit.org/show_bug.cgi?id=212516
+
+ Reviewed by Žan Doberšek.
+
+ The ASSERT that was failing was wrong. It was assuming that every simulated device should be part of the list
+ of immersive devices. That's wrong, as devices only supporting inline sessions are not in that list.
+
+ Apart from that, fake devices were not removed from the list of available devices in WebXRTest after
+ disconnecting them all. That could potentially cause flakiness in the tests.
+
+ No new test required as the current tests were properly detecting the issue.
+
+ * Modules/webxr/WebXRSystem.cpp:
+ (WebCore::WebXRSystem::registerSimulatedXRDeviceForTesting): Use XRSessionMode directly.
+ (WebCore::WebXRSystem::unregisterSimulatedXRDeviceForTesting): Fixed the ASSERT. A simulated device
+ might not be in the list of immersive devices if only supports inline sessions.
+ * testing/WebXRTest.cpp:
+ (WebCore::WebXRTest::disconnectAllDevices): Clear the list of devices after disconnecting.
+
2020-05-29 Youenn Fablet <[email protected]>
MediaPlayerPrivateMediaStreamAVFObjC should enqueue samples in a background thread
Modified: trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp (262290 => 262291)
--- trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp 2020-05-29 12:47:12 UTC (rev 262290)
+++ trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp 2020-05-29 13:18:06 UTC (rev 262291)
@@ -439,11 +439,11 @@
if (!RuntimeEnabledFeatures::sharedFeatures().webXREnabled())
return;
m_testingDevices++;
- if (device.supports(PlatformXR::SessionMode::ImmersiveVr) || device.supports(PlatformXR::SessionMode::ImmersiveAr)) {
+ if (device.supports(XRSessionMode::ImmersiveVr) || device.supports(XRSessionMode::ImmersiveAr)) {
m_immersiveDevices.add(device);
m_activeImmersiveDevice = makeWeakPtr(device);
}
- if (device.supports(PlatformXR::SessionMode::Inline))
+ if (device.supports(XRSessionMode::Inline))
m_inlineXRDevice = makeWeakPtr(device);
}
@@ -451,9 +451,9 @@
{
if (!RuntimeEnabledFeatures::sharedFeatures().webXREnabled())
return;
- ASSERT(m_immersiveDevices.contains(device));
ASSERT(m_testingDevices);
- m_immersiveDevices.remove(device);
+ bool removed = m_immersiveDevices.remove(device);
+ ASSERT_UNUSED(removed, removed || m_inlineXRDevice == &device);
if (m_activeImmersiveDevice == &device)
m_activeImmersiveDevice = nullptr;
if (m_inlineXRDevice == &device)
Modified: trunk/Source/WebCore/testing/WebXRTest.cpp (262290 => 262291)
--- trunk/Source/WebCore/testing/WebXRTest.cpp 2020-05-29 12:47:12 UTC (rev 262290)
+++ trunk/Source/WebCore/testing/WebXRTest.cpp 2020-05-29 13:18:06 UTC (rev 262291)
@@ -111,6 +111,7 @@
{
for (auto& device : m_devices)
m_context->unregisterSimulatedXRDeviceForTesting(device->simulatedXRDevice());
+ m_devices.clear();
promise.resolve();
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes