haikuwebkit/LayoutTests/remote-layer-tree/ios/uiview-tree-basic.html

34 lines
798 B
HTML
Raw Permalink Normal View History

Allow testing of the final UIView tree on iOS platforms https://bugs.webkit.org/show_bug.cgi?id=229016 Reviewed by Tim Horton. Source/WebKit: Test: remote-layer-tree/ios/uiview-tree-basic.html * UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h: * UIProcess/API/ios/WKWebViewTestingIOS.mm: (allowListedClassToString): (dumpUIView): (-[WKWebView _uiViewTreeAsText]): Add partner SPI called _uiViewTreeAsText that dumps the WKWebView's UIView tree as constructed via remote layer creation. It currently dumps some basic properties of each view and uses an allow list of class names so changes to implementation details in frameworks below us, like UIKit, don't cause tests to fail. Tools: * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: * TestRunnerShared/UIScriptContext/UIScriptController.h: (WTR::UIScriptController::uiViewTreeAsText const): * WebKitTestRunner/ios/UIScriptControllerIOS.h: * WebKitTestRunner/ios/UIScriptControllerIOS.mm: (WTR::UIScriptControllerIOS::uiViewTreeAsText const): Pipe new _uiViewTreeAsText SPI through to UIScriptController, matching the pattern established by scrollingTreeAsText. LayoutTests: * remote-layer-tree: Added. * remote-layer-tree/ios: Added. * remote-layer-tree/ios/uiview-tree-basic-expected.txt: Added. * remote-layer-tree/ios/uiview-tree-basic.html: Added. Add basic test case excercising UIView tree dumping to ensure it is working properly. * resources/ui-helper.js: (window.UIHelper.getUIViewTree): Add helper to use get the UIView tree as text. * TestExpectations: * platform/ios/TestExpectations: Ensure these tests are only run on iOS. Canonical link: https://commits.webkit.org/240481@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-12 20:16:51 +00:00
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/ui-helper.js"></script>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
async function doTest()
{
await UIHelper.ensureStablePresentationUpdate();
let tree = await UIHelper.getUIViewTree();
document.getElementById('test').remove();
let output = document.createElement('pre');
document.body.append(output);
output.textContent = tree;
testRunner.notifyDone();
}
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<div id="test">
<div style="will-change: transform;">Hello</div>
</div>
</body>
</html>