Skip to content
Permalink
Browse files
After commit 039ebd9, some tests run with ITM disabled despite --acce…
…ssibility-isolated-tree flag being passed

https://bugs.webkit.org/show_bug.cgi?id=240627

Reviewed by Chris Fleizach.

039ebd9 changed TestController::resetStateToConsistentValues to only send the "Reset" message to the testing InjectedBundle after a test completed, rather than before and after each test. This is a good and logical change, but exposed a bug in how we set InjectedBundle::m_accessibilityIsolatedTree, since we relied on this "Reset" behavior to setup this member variable.

With this patch, we instead set InjectedBundle::m_accessibilityIsolatedTree in response to the "BeginTest" message, which fixes the issue.

* Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
* Tools/WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::createTestSettingsDictionary):

Canonical link: https://commits.webkit.org/250802@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294547 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
twilco committed May 20, 2022
1 parent 5bee052 commit 5afc7631bdc775f8d034e228e740e23ce5d551bd
Showing 3 changed files with 6 additions and 8 deletions.
@@ -192,6 +192,9 @@ void InjectedBundle::didReceiveMessageToPage(WKBundlePageRef page, WKStringRef m
if (WKStringIsEqualToUTF8CString(messageName, "BeginTest")) {
ASSERT(messageBody);
auto messageBodyDictionary = dictionaryValue(messageBody);
#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
m_accessibilityIsolatedTreeMode = booleanValue(messageBodyDictionary, "IsAccessibilityIsolatedTreeEnabled");
#endif
WKBundlePagePostMessage(page, toWK("Ack").get(), toWK("BeginTest").get());
beginTesting(messageBodyDictionary, BegingTestingMode::New);
return;
@@ -205,10 +208,6 @@ void InjectedBundle::didReceiveMessageToPage(WKBundlePageRef page, WKStringRef m
if (booleanValue(messageBodyDictionary, "ShouldGC"))
WKBundleGarbageCollectJavaScriptObjects(m_bundle.get());

#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
m_accessibilityIsolatedTreeMode = booleanValue(messageBodyDictionary, "AccessibilityIsolatedTree");
#endif

auto allowedHostsValue = value(messageBodyDictionary, "AllowedHosts");
if (allowedHostsValue && WKGetTypeID(allowedHostsValue) == WKArrayGetTypeID()) {
m_allowedHosts.clear();
@@ -1020,10 +1020,6 @@ bool TestController::resetStateToConsistentValues(const TestOptions& options, Re
WKArrayAppendItem(allowedHostsValue.get(), toWK(host.c_str()).get());
setValue(resetMessageBody, "AllowedHosts", allowedHostsValue);

#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
setValue(resetMessageBody, "AccessibilityIsolatedTree", options.accessibilityIsolatedTreeMode());
#endif

auto jscOptions = options.jscOptions();
if (!jscOptions.empty())
setValue(resetMessageBody, "JSCOptions", jscOptions.c_str());
@@ -133,6 +133,9 @@ bool TestInvocation::shouldLogHistoryClientCallbacks() const
WKRetainPtr<WKMutableDictionaryRef> TestInvocation::createTestSettingsDictionary()
{
auto beginTestMessageBody = adoptWK(WKMutableDictionaryCreate());
#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
setValue(beginTestMessageBody, "IsAccessibilityIsolatedTreeEnabled", options().accessibilityIsolatedTreeMode());
#endif
setValue(beginTestMessageBody, "UseFlexibleViewport", options().useFlexibleViewport());
setValue(beginTestMessageBody, "DumpPixels", m_dumpPixels);
setValue(beginTestMessageBody, "Timeout", static_cast<uint64_t>(m_timeout.milliseconds()));

0 comments on commit 5afc763

Please sign in to comment.