⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 277206 in webkit


Ignore:
Timestamp:
May 7, 2021, 3:23:52 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, reverting r277201.
​https://bugs.webkit.org/show_bug.cgi?id=225542

Includes project file change.

Reverted changeset:

"[iOS] Make AccessibilityReduceMotion test case work on iOS"
​https://bugs.webkit.org/show_bug.cgi?id=225244
​https://trac.webkit.org/changeset/277201

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r277201 r277206  
     12021-05-07  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, reverting r277201.
     4        https://bugs.webkit.org/show_bug.cgi?id=225542
     5
     6        Includes project file change.
     7
     8        Reverted changeset:
     9
     10        "[iOS] Make AccessibilityReduceMotion test case work on iOS"
     11        https://bugs.webkit.org/show_bug.cgi?id=225244
     12        https://trac.webkit.org/changeset/277201
     13
    1142021-05-07  Brent Fulgham  <bfulgham@apple.com>
    215
  • trunk/Source/WebKit/Platform/spi/Cocoa/AccessibilitySupportSPI.h

    r277201 r277206  
    4141#endif
    4242
    43 #if PLATFORM(IOS_FAMILY)
    44 extern CFStringRef kAXSReduceMotionPreference;
    45 extern CFStringRef kAXSReduceMotionChangedNotification;
    46 #endif
    47 
    4843#if PLATFORM(IOS_FAMILY) && ENABLE(FULL_KEYBOARD_ACCESS)
    4944extern CFStringRef kAXSFullKeyboardAccessEnabledNotification;
  • trunk/Tools/ChangeLog

    r277202 r277206  
     12021-05-07  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, reverting r277201.
     4        https://bugs.webkit.org/show_bug.cgi?id=225542
     5
     6        Includes project file change.
     7
     8        Reverted changeset:
     9
     10        "[iOS] Make AccessibilityReduceMotion test case work on iOS"
     11        https://bugs.webkit.org/show_bug.cgi?id=225244
     12        https://trac.webkit.org/changeset/277201
     13
    1142021-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
    215
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/xcshareddata/xcschemes/TestWebKitAPI.xcscheme

    r277201 r277206  
    5151         </BuildableReference>
    5252      </BuildableProductRunnable>
    53       <CommandLineArguments>
    54          <CommandLineArgument
    55             argument = "--gtest_filter=WebKit.AccessibilityReduceMotion"
    56             isEnabled = "YES">
    57          </CommandLineArgument>
    58       </CommandLineArguments>
    5953   </LaunchAction>
    6054   <ProfileAction
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/AccessibilityReduceMotion.mm

    r277201 r277206  
    2626#import "config.h"
    2727
    28 #if ENABLE(CFPREFS_DIRECT_MODE)
     28#if WK_HAVE_C_SPI && ENABLE(CFPREFS_DIRECT_MODE)
    2929
    3030#import "PlatformUtilities.h"
    3131#import "TestWKWebView.h"
    32 #import "WKWebViewConfigurationExtras.h"
    3332#import <WebKit/PreferenceObserver.h>
    3433#import <WebKit/WKProcessPoolPrivate.h>
    3534#import <WebKit/_WKProcessPoolConfiguration.h>
    3635
    37 #if PLATFORM(MAC)
    3836#import <pal/spi/mac/HIServicesSPI.h>
    39 #endif
    40 
    41 #if PLATFORM(IOS_FAMILY)
    42 #include <pal/spi/cocoa/AccessibilitySupportSPI.h>
    43 #include <wtf/SoftLinking.h>
    44 
    45 SOFT_LINK_LIBRARY(libAccessibility)
    46 SOFT_LINK_CONSTANT(libAccessibility, kAXSReduceMotionPreference, CFStringRef);
    47 SOFT_LINK_CONSTANT(libAccessibility, kAXSReduceMotionChangedNotification, CFStringRef);
    48 
    49 #define NOTIFICATION_CENTER CFNotificationCenterGetDarwinNotifyCenter()
    50 #define REDUCED_MOTION_PREFERENCE getkAXSReduceMotionPreference()
    51 #define REDUCED_MOTION_CHANGED_NOTIFICATION getkAXSReduceMotionChangedNotification()
    52 #define ACCESSIBILITY_DOMAIN CFSTR("com.apple.Accessibility")
    53 #else
    54 #define NOTIFICATION_CENTER CFNotificationCenterGetDistributedCenter()
    55 #define REDUCED_MOTION_PREFERENCE kAXInterfaceReduceMotionKey
    56 #define REDUCED_MOTION_CHANGED_NOTIFICATION kAXInterfaceReduceMotionStatusDidChangeNotification
    57 #define ACCESSIBILITY_DOMAIN CFSTR("com.apple.universalaccess")
    58 #endif
    5937
    6038static bool reduceMotionNotificationReceived = false;
    … …  
    7351@end
    7452
    75 static void notificationCallback(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo)
    76 {
    77     reduceMotionNotificationReceived = true;
    78 }
    79 
    8053TEST(WebKit, AccessibilityReduceMotion)
    8154{
    82     CFNotificationCenterAddObserver(NOTIFICATION_CENTER, nullptr, &notificationCallback, REDUCED_MOTION_CHANGED_NOTIFICATION, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately);
     55    RetainPtr<NSObject> accessibilityObserver = [[NSDistributedNotificationCenter defaultCenter] addObserverForName:(__bridge id)kAXInterfaceReduceMotionStatusDidChangeNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *note) {
     56        reduceMotionNotificationReceived = true;
     57    }];
    8358
    84     WKWebViewConfiguration *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"WebProcessPlugInWithInternals" configureJSCForTesting:YES];
    85     auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 300, 300) configuration:configuration addToWindow:YES]);
     59    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
     60    WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
     61    configuration.get().processPool = (WKProcessPool *)context.get();
     62    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 300, 300) configuration:configuration.get() addToWindow:YES]);
    8663
    87     CFPreferencesSetAppValue(REDUCED_MOTION_PREFERENCE, kCFBooleanFalse, ACCESSIBILITY_DOMAIN);
     64    CFPreferencesSetAppValue(kAXInterfaceReduceMotionKey, kCFBooleanFalse, CFSTR("com.apple.universalaccess"));
    8865
    8966    auto observer = adoptNS([[WKPreferenceObserverForTesting alloc] init]);
    … …  
    9168    [webView synchronouslyLoadTestPageNamed:@"simple"];
    9269
     70    CFPreferencesSetAppValue(kAXInterfaceReduceMotionKey, kCFBooleanTrue, CFSTR("com.apple.universalaccess"));
     71
     72    TestWebKitAPI::Util::run(&receivedPreferenceNotification);
     73
    9374    auto reduceMotion = [&] {
    9475        return [webView stringByEvaluatingJavaScript:@"window.internals.userPrefersReducedMotion()"].boolValue;
    9576    };
     77   
     78    [webView synchronouslyLoadTestPageNamed:@"simple"];
    9679
    97     ASSERT_FALSE(reduceMotion());
    98 
    99     reduceMotionNotificationReceived = false;
    100 
    101     CFPreferencesSetAppValue(REDUCED_MOTION_PREFERENCE, kCFBooleanTrue, ACCESSIBILITY_DOMAIN);
    102 
    103     TestWebKitAPI::Util::run(&receivedPreferenceNotification);
    10480    TestWebKitAPI::Util::run(&reduceMotionNotificationReceived);
    105 
    106     [webView synchronouslyLoadTestPageNamed:@"simple"];
    10781
    10882    ASSERT_TRUE(reduceMotion());
    10983
    110     CFPreferencesSetAppValue(REDUCED_MOTION_PREFERENCE, nullptr, ACCESSIBILITY_DOMAIN);
     84    CFPreferencesSetAppValue(kAXInterfaceReduceMotionKey, nullptr, CFSTR("com.apple.universalaccess"));
    11185
    112     CFNotificationCenterRemoveObserver(NOTIFICATION_CENTER, nullptr, REDUCED_MOTION_CHANGED_NOTIFICATION, nullptr);
     86    [[NSNotificationCenter defaultCenter] removeObserver:accessibilityObserver.get()];
    11387}
    11488
Note: See TracChangeset for help on using the changeset viewer.