summaryrefslogtreecommitdiffstats
path: root/python/mozperftest/mozperftest/system/__init__.py
blob: 55deb9094d77dea4642835e2e2af24f70341941f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from mozperftest.layers import Layers
from mozperftest.system.android import AndroidDevice
from mozperftest.system.android_startup import AndroidStartUp
from mozperftest.system.macos import MacosDevice
from mozperftest.system.pingserver import PingServer
from mozperftest.system.profile import Profile
from mozperftest.system.proxy import ProxyRunner


def get_layers():
    return PingServer, Profile, ProxyRunner, AndroidDevice, MacosDevice, AndroidStartUp


def pick_system(env, flavor, mach_cmd):
    if flavor in ("desktop-browser", "xpcshell"):
        return Layers(
            env,
            mach_cmd,
            (
                PingServer,  # needs to come before Profile
                MacosDevice,
                Profile,
                ProxyRunner,
            ),
        )
    if flavor == "mobile-browser":
        return Layers(
            env, mach_cmd, (Profile, ProxyRunner, AndroidDevice, AndroidStartUp)
        )
    if flavor == "webpagetest":
        return Layers(env, mach_cmd, (Profile,))
    raise NotImplementedError(flavor)