/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { test } from '@playwright/test';
import os from 'os';
function platform() {
    if (process.env.PLAYWRIGHT_SERVICE_OS === 'linux')
        return 'linux';
    if (process.env.PLAYWRIGHT_SERVICE_OS === 'windows')
        return 'win32';
    if (process.env.PLAYWRIGHT_SERVICE_OS === 'macos')
        return 'darwin';
    return process.platform;
}
function macVersion() {
    if (process.platform !== 'darwin')
        return 0;
    const darwinMajor = +os.release().split('.')[0];
    // Apple jumped from macOS 15 (Sequoia) to macOS 26 (Tahoe), so Darwin 25 = macOS 26.
    if (darwinMajor >= 25)
        return darwinMajor + 1;
    return darwinMajor - 9;
}
export const platformTest = test.extend({
    platform: [platform(), { scope: 'worker' }],
    isWindows: [platform() === 'win32', { scope: 'worker' }],
    isMac: [platform() === 'darwin', { scope: 'worker' }],
    isLinux: [platform() === 'linux', { scope: 'worker' }],
    macVersion: [macVersion(), { scope: 'worker' }],
});
//# sourceMappingURL=platformFixtures.js.map