2020-04-14 10:46:51 +03:00
|
|
|
# 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/.
|
2020-12-14 20:50:17 +03:00
|
|
|
from __future__ import absolute_import
|
2020-04-14 10:46:51 +03:00
|
|
|
import os
|
2020-06-04 21:31:54 +03:00
|
|
|
from mozperftest.test.browsertime import add_options, add_option
|
2020-04-14 10:46:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
sites = os.path.join(os.path.dirname(__file__), "sites.txt")
|
|
|
|
with open(sites) as f:
|
|
|
|
sites = [site for site in f.read().split("\n") if site.strip()]
|
|
|
|
|
|
|
|
|
|
|
|
def next_site():
|
|
|
|
for site in sites:
|
|
|
|
yield site
|
|
|
|
|
|
|
|
|
|
|
|
get_site = next_site()
|
|
|
|
|
|
|
|
options = [
|
|
|
|
("firefox.preference", "network.http.speculative-parallel-limit:6"),
|
|
|
|
# XXX potentially move those as first class options in mozperf?
|
|
|
|
("pageCompleteWaitTime", "10000"),
|
|
|
|
("visualMetrics", "true"),
|
|
|
|
("video", "true"),
|
|
|
|
("firefox.windowRecorder", "false"),
|
|
|
|
("videoParams.addTimer", "false"),
|
|
|
|
("videoParams.createFilmstrip", "false"),
|
|
|
|
("videoParams.keepOriginalVideo", "true"),
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2020-04-17 18:08:25 +03:00
|
|
|
def before_runs(env, **kw):
|
|
|
|
env.set_arg("cycles", len(sites))
|
|
|
|
add_options(env, options)
|
2020-04-14 10:46:51 +03:00
|
|
|
|
|
|
|
|
2020-04-17 18:08:25 +03:00
|
|
|
def before_cycle(env, **kw):
|
2020-04-14 10:46:51 +03:00
|
|
|
url = next(get_site)
|
2020-04-17 18:08:25 +03:00
|
|
|
add_option(env, "browsertime.url", url)
|