Changeset 280980 in webkit
- Timestamp:
- Aug 12, 2021, 1:16:51 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 12 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/ios/TestExpectations (modified) (1 diff)
-
LayoutTests/remote-layer-tree (added)
-
LayoutTests/remote-layer-tree/ios (added)
-
LayoutTests/remote-layer-tree/ios/uiview-tree-basic-expected.txt (added)
-
LayoutTests/remote-layer-tree/ios/uiview-tree-basic.html (added)
-
LayoutTests/resources/ui-helper.js (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h (modified) (1 diff)
-
Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (modified) (1 diff)
-
Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (modified) (1 diff)
-
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h (modified) (1 diff)
-
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280960 r280980 1 2021-08-12 Sam Weinig <weinig@apple.com> 2 3 Allow testing of the final UIView tree on iOS platforms 4 https://bugs.webkit.org/show_bug.cgi?id=229016 5 6 Reviewed by Tim Horton. 7 8 * remote-layer-tree: Added. 9 * remote-layer-tree/ios: Added. 10 * remote-layer-tree/ios/uiview-tree-basic-expected.txt: Added. 11 * remote-layer-tree/ios/uiview-tree-basic.html: Added. 12 Add basic test case excercising UIView tree dumping to ensure 13 it is working properly. 14 15 * resources/ui-helper.js: 16 (window.UIHelper.getUIViewTree): 17 Add helper to use get the UIView tree as text. 18 19 * TestExpectations: 20 * platform/ios/TestExpectations: 21 Ensure these tests are only run on iOS. 22 1 23 2021-08-12 Martin Robinson <mrobinson@webkit.org> 2 24 -
trunk/LayoutTests/TestExpectations
r280963 r280980 83 83 fast/media/ios [ Skip ] 84 84 fast/dom/Range/mac [ Skip ] 85 remote-layer-tree/ios [ Skip ] 85 86 inspector/page/setScreenSizeOverride.html [ Skip ] 86 87 -
trunk/LayoutTests/platform/ios/TestExpectations
r280794 r280980 19 19 quicklook [ Pass ] 20 20 system-preview [ Pass ] 21 remote-layer-tree/ios [ Pass ] 21 22 swipe [ Pass ] 22 23 http/tests/swipe [ Pass ] -
trunk/LayoutTests/resources/ui-helper.js
r280767 r280980 1406 1406 testRunner.runUIScript(`(() => { 1407 1407 return uiController.scrollingTreeAsText; 1408 })()`, resolve); 1409 }); 1410 } 1411 1412 static getUIViewTree() 1413 { 1414 if (!this.isWebKit2() || !this.isIOSFamily()) 1415 return Promise.resolve(); 1416 1417 return new Promise(resolve => { 1418 testRunner.runUIScript(`(() => { 1419 return uiController.uiViewTreeAsText; 1408 1420 })()`, resolve); 1409 1421 }); -
trunk/Source/WebKit/ChangeLog
r280976 r280980 1 2021-08-12 Sam Weinig <weinig@apple.com> 2 3 Allow testing of the final UIView tree on iOS platforms 4 https://bugs.webkit.org/show_bug.cgi?id=229016 5 6 Reviewed by Tim Horton. 7 8 Test: remote-layer-tree/ios/uiview-tree-basic.html 9 10 * UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h: 11 * UIProcess/API/ios/WKWebViewTestingIOS.mm: 12 (allowListedClassToString): 13 (dumpUIView): 14 (-[WKWebView _uiViewTreeAsText]): 15 Add partner SPI called _uiViewTreeAsText that dumps the WKWebView's 16 UIView tree as constructed via remote layer creation. It currently 17 dumps some basic properties of each view and uses an allow list of 18 class names so changes to implementation details in frameworks below 19 us, like UIKit, don't cause tests to fail. 20 1 21 2021-08-12 Jer Noble <jer.noble@apple.com> 2 22 -
trunk/Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h
r280767 r280980 44 44 @property (nonatomic, readonly) CGRect _inputViewBoundsInWindow; 45 45 @property (nonatomic, readonly) NSString *_scrollingTreeAsText; 46 @property (nonatomic, readonly) NSString *_uiViewTreeAsText; 46 47 @property (nonatomic, readonly) NSNumber *_stableStateOverride; 47 48 @property (nonatomic, readonly) CGRect _dragCaretRect; -
trunk/Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm
r280767 r280980 42 42 #import <WebCore/ColorSerialization.h> 43 43 #import <WebCore/ElementContext.h> 44 #import <wtf/SortedArrayMap.h> 45 #import <wtf/text/TextStream.h> 44 46 45 47 @implementation WKWebView (WKTestingIOS) … … 228 230 } 229 231 232 static String allowListedClassToString(UIView *view) 233 { 234 static constexpr ComparableASCIILiteral allowedClassesArray[] = { 235 "UIView", 236 "WKBackdropView", 237 "WKCompositingView", 238 "WKContentView", 239 "WKModelView", 240 "WKRemoteView", 241 "WKScrollView", 242 "WKSeparatedModelView" 243 "WKShapeView", 244 "WKSimpleBackdropView", 245 "WKTransformView", 246 "WKUIRemoteView", 247 "WKWebView", 248 "_UILayerHostView", 249 }; 250 static constexpr SortedArraySet allowedClasses { allowedClassesArray }; 251 252 String classString { NSStringFromClass(view.class) }; 253 if (allowedClasses.contains(classString)) 254 return classString; 255 256 ASSERT(classString != "WKCompositingView"); 257 return makeString("<class not in allowed list of classes>"); 258 } 259 260 static void dumpUIView(TextStream& ts, UIView *view) 261 { 262 auto rectToString = [] (auto rect) { 263 return makeString("[x: ", rect.origin.x, " y: ", rect.origin.x, " width: ", rect.size.width, " height: ", rect.size.height, "]"); 264 }; 265 266 auto pointToString = [] (auto point) { 267 return makeString("[x: ", point.x, " y: ", point.x, "]"); 268 }; 269 270 271 ts << "view [class: " << allowListedClassToString(view) << "]"; 272 273 ts.dumpProperty("layer bounds", rectToString(view.layer.bounds)); 274 275 if (view.layer.position.x != 0 || view.layer.position.y != 0) 276 ts.dumpProperty("layer position", pointToString(view.layer.position)); 277 278 if (view.layer.zPosition != 0) 279 ts.dumpProperty("layer zPosition", makeString(view.layer.zPosition)); 280 281 if (view.layer.anchorPoint.x != 0.5 || view.layer.anchorPoint.y != 0.5) 282 ts.dumpProperty("layer anchorPoint", pointToString(view.layer.anchorPoint)); 283 284 if (view.layer.anchorPointZ != 0) 285 ts.dumpProperty("layer anchorPointZ", makeString(view.layer.anchorPointZ)); 286 287 if (view.subviews.count > 0) { 288 TextStream::GroupScope scope(ts); 289 ts << "subviews"; 290 for (UIView *subview in view.subviews) { 291 TextStream::GroupScope scope(ts); 292 dumpUIView(ts, subview); 293 } 294 } 295 } 296 297 - (NSString *)_uiViewTreeAsText 298 { 299 TextStream ts(TextStream::LineMode::MultipleLine); 300 301 { 302 TextStream::GroupScope scope(ts); 303 ts << "UIView tree root "; 304 dumpUIView(ts, self); 305 } 306 307 return ts.release(); 308 } 309 230 310 - (NSNumber *)_stableStateOverride 231 311 { -
trunk/Tools/ChangeLog
r280973 r280980 1 2021-08-12 Sam Weinig <weinig@apple.com> 2 3 Allow testing of the final UIView tree on iOS platforms 4 https://bugs.webkit.org/show_bug.cgi?id=229016 5 6 Reviewed by Tim Horton. 7 8 * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: 9 * TestRunnerShared/UIScriptContext/UIScriptController.h: 10 (WTR::UIScriptController::uiViewTreeAsText const): 11 * WebKitTestRunner/ios/UIScriptControllerIOS.h: 12 * WebKitTestRunner/ios/UIScriptControllerIOS.mm: 13 (WTR::UIScriptControllerIOS::uiViewTreeAsText const): 14 Pipe new _uiViewTreeAsText SPI through to UIScriptController, matching the pattern 15 established by scrollingTreeAsText. 16 1 17 2021-08-12 Devin Rousso <drousso@apple.com> 2 18 -
trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
r280767 r280980 333 333 334 334 readonly attribute DOMString scrollingTreeAsText; 335 readonly attribute DOMString uiViewTreeAsText; 335 336 336 337 boolean mayContainEditableElementsInRect(unsigned long x, unsigned long y, unsigned long width, unsigned long height); -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
r280767 r280980 147 147 148 148 virtual JSRetainPtr<JSStringRef> scrollingTreeAsText() const { notImplemented(); return nullptr; } 149 virtual JSRetainPtr<JSStringRef> uiViewTreeAsText() const { notImplemented(); return nullptr; } 149 150 150 151 // Touches -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h
r280767 r280980 118 118 JSObjectRef inputViewBounds() const override; 119 119 JSRetainPtr<JSStringRef> scrollingTreeAsText() const override; 120 JSRetainPtr<JSStringRef> uiViewTreeAsText() const override; 120 121 JSObjectRef propertiesOfLayerWithID(uint64_t layerID) const override; 121 122 void simulateRotation(DeviceOrientation*, JSValueRef) override; -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
r280767 r280980 858 858 } 859 859 860 JSRetainPtr<JSStringRef> UIScriptControllerIOS::uiViewTreeAsText() const 861 { 862 return adopt(JSStringCreateWithCFString((CFStringRef)[webView() _uiViewTreeAsText])); 863 } 864 860 865 JSObjectRef UIScriptControllerIOS::propertiesOfLayerWithID(uint64_t layerID) const 861 866 {
Note:
See TracChangeset
for help on using the changeset viewer.