1# This Source Code Form is subject to the terms of the Mozilla Public 2# License, v. 2.0. If a copy of the MPL was not distributed with this 3# file, You can obtain one at http://mozilla.org/MPL/2.0/. 4from mozperftest.layers import Layers 5from mozperftest.system.proxy import ProxyRunner 6from mozperftest.system.android import AndroidDevice 7from mozperftest.system.profile import Profile 8from mozperftest.system.macos import MacosDevice 9from mozperftest.system.pingserver import PingServer 10 11 12def get_layers(): 13 return PingServer, Profile, ProxyRunner, AndroidDevice, MacosDevice 14 15 16def pick_system(env, flavor, mach_cmd): 17 if flavor in ("desktop-browser", "xpcshell"): 18 return Layers( 19 env, 20 mach_cmd, 21 ( 22 PingServer, # needs to come before Profile 23 MacosDevice, 24 Profile, 25 ProxyRunner, 26 ), 27 ) 28 if flavor == "mobile-browser": 29 return Layers(env, mach_cmd, (Profile, ProxyRunner, AndroidDevice)) 30 raise NotImplementedError(flavor) 31