[webkit-changes] [WebKit/WebKit] f88f9f: [Screen Time Refactoring] Add WKWebView property t...

Jessica Cheung noreply at github.com
Sun Dec 22 16:21:38 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f88f9f5479fc740fee30965236a5a89ae213598c
      https://github.com/WebKit/WebKit/commit/f88f9f5479fc740fee30965236a5a89ae213598c
  Author: Jessica Cheung <jcheung23 at apple.com>
  Date:   2024-12-22 (Sun, 22 Dec 2024)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
    M Tools/TestWebKitAPI/SourcesCocoa.txt
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WebKitCocoa/ScreenTime.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/SystemPreview.mm

  Log Message:
  -----------
  [Screen Time Refactoring] Add WKWebView property to detect Screen Time blocking
https://bugs.webkit.org/show_bug.cgi?id=284703
rdar://140438960

Reviewed by Aditya Keerthi.

Created new API and property `_isBlockedByScreenTime` to indicate
if ScreenTime blocking is active.
Added API tests for new property.
Added missing header files for tests `SystemPreview.mm`.

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _installScreenTimeWebpageController]):
(-[WKWebView observeValueForKeyPath:ofObject:change:context:]):
(-[WKWebView _isBlockedByScreenTime]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Tools/TestWebKitAPI/SourcesCocoa.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ScreenTime.mm: Added.
(webViewForScreenTimeTests):
(-[BlockedStateObserver initWithWebView:]):
(-[BlockedStateObserver observeValueForKeyPath:ofObject:change:context:]):
(TEST(ScreenTime, IsBlockedByScreenTimeTrue)):
(TEST(ScreenTime, IsBlockedByScreenTimeFalse)):
(TEST(ScreenTime, IsBlockedByScreenTimeMultiple)):
(TEST(ScreenTime, IsBlockedByScreenTimeKVO)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SystemPreview.mm:

Canonical link: https://commits.webkit.org/288240@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list