Bug 228313 - LayoutTestHelper does not correctly restore color profiles for some devices
Summary: LayoutTestHelper does not correctly restore color profiles for some devices
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks: 188320
  Show dependency treegraph
 
Reported: 2021-07-26 22:07 PDT by Cameron McCormack (:heycam)
Modified: 2021-08-10 16:51 PDT (History)
3 users (show)

See Also:


Attachments
Patch (3.44 KB, patch)
2021-07-26 22:34 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2021-07-26 22:07:50 PDT
LayoutTestHelper only looks for profiles named "1", which is a default profile name.  Some devices have multiple profile names, such as my external monitor, which has this device info dictionary:

(lldb) po deviceInfo
{
    CustomProfiles =     {
        "HDMI HD" = "file:///System/Library/ColorSync/Profiles/sRGB%20Profile.icc";
    };
    DeviceClass = mntr;
    DeviceDescription = "ASUS PB27U";
    DeviceHostScope = kCFPreferencesCurrentHost;
    DeviceID = "<CFUUID 0x6000037cc3e0> 4261DDFA-A1B4-1E80-AD62-026351A927F0";
    DeviceUserScope = kCFPreferencesAnyUser;
    FactoryProfiles =     {
        DeviceDefaultProfileID = "HDMI HD";
        "HDMI HD" =         {
            DeviceModeDescription = "HDMI HD";
            DeviceProfileURL = "file:///Library/ColorSync/Profiles/Displays/ASUS%20PB27U-4261DDFA-A1B4-1E80-AD62-026351A927F0.icc";
        };
        "HDMI SD" =         {
            DeviceModeDescription = "HDMI SD";
            DeviceProfileURL = "file:///System/Library/CoreServices/Resources/Profiles/SD%20170M-A.icc";
        };
    };
}

We should look at the DeviceDefaultProfileID and use that as the profile name.
Comment 1 Cameron McCormack (:heycam) 2021-07-26 22:10:51 PDT
s/profile name/mode/, maybe.
Comment 2 Radar WebKit Bug Importer 2021-07-26 22:11:04 PDT
<rdar://problem/81146417>
Comment 3 Cameron McCormack (:heycam) 2021-07-26 22:34:38 PDT
Created attachment 434270 [details]
Patch
Comment 4 EWS 2021-08-10 16:51:46 PDT
Committed r280871 (240410@main): <https://commits.webkit.org/240410@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434270 [details].