Make arguments of run-benchmark more user friendly
[WebKit-https.git] / Tools / Scripts / webkitpy / benchmark_runner / browser_driver / browser_driver_factory.py
1 #!/usr/bin/env python
2
3 import logging
4 import json
5 import os
6
7 from webkitpy.benchmark_runner.generic_factory import GenericFactory
8 from webkitpy.benchmark_runner.utils import loadJSONFromFile
9
10
11 driverFileName = 'browser_drivers.json'
12
13
14 class BrowserDriverFactory(GenericFactory):
15
16     products = loadJSONFromFile(os.path.join(os.path.dirname(__file__), driverFileName))
17
18     @classmethod
19     def available_platforms(cls):
20         return cls.products.keys()
21
22     @classmethod
23     def available_browsers(cls):
24         browsers = []
25         for platform in cls.products.values():
26             for browser in platform:
27                 browsers.append(browser)
28         return browsers