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/.
4
5from __future__ import absolute_import
6
7import os
8
9from talos import filter
10
11"""
12test definitions for Talos
13"""
14
15_TESTS = {}  # internal dict of Talos test classes
16
17
18def register_test():
19    """Decorator to register Talos test classes"""
20
21    def wrapper(klass):
22        assert issubclass(klass, Test)
23        assert klass.name() not in _TESTS
24
25        _TESTS[klass.name()] = klass
26        return klass
27
28    return wrapper
29
30
31def test_dict():
32    """Return the dict of the registered test classes"""
33    return _TESTS
34
35
36class Test(object):
37    """abstract base class for a Talos test case"""
38
39    __test__ = False  # not pytest
40
41    cycles = None  # number of cycles
42    keys = []
43    desktop = True
44    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
45    lower_is_better = True
46    alert_threshold = 2.0
47    perfherder_framework = "talos"
48    subtest_alerts = False
49    suite_should_alert = True
50
51    @classmethod
52    def name(cls):
53        return cls.__name__
54
55    @classmethod
56    def description(cls):
57        if cls.__doc__ is None:
58            return "No documentation available yet."
59        else:
60            doc = cls.__doc__
61            description_lines = [i.strip() for i in doc.strip().splitlines()]
62            return "\n".join(description_lines)
63
64    def __init__(self, **kw):
65        self.update(**kw)
66
67    def update(self, **kw):
68        self.__dict__.update(kw)
69
70    def items(self):
71        """
72        returns a list of 2-tuples
73        """
74        retval = [("name", self.name())]
75        for key in self.keys:
76            value = getattr(self, key, None)
77            if value is not None:
78                retval.append((key, value))
79        return retval
80
81    def __str__(self):
82        """string form appropriate for YAML output"""
83        items = self.items()
84
85        key, value = items.pop(0)
86        lines = ["- %s: %s" % (key, value)]
87        for key, value in items:
88            lines.append("  %s: %s" % (key, value))
89        return "\n".join(lines)
90
91
92# ts-style startup tests (ts, twinopen, ts_cold, etc)
93# The overall test number is calculated by excluding the max opening time
94# and taking an average of the remaining numbers.
95class TsBase(Test):
96    """abstract base class for ts-style tests"""
97
98    keys = [
99        "url",
100        "url_timestamp",
101        "timeout",
102        "cycles",
103        "profile_path",  # The path containing the template profile. This
104        # directory is copied to the temporary profile during
105        # initialization of the test. If some of the files may
106        # be overwritten by Firefox and need to be reinstalled
107        # before each pass, use key |reinstall|
108        "gecko_profile",
109        "gecko_profile_interval",
110        "gecko_profile_entries",
111        "gecko_profile_features",
112        "gecko_profile_threads",
113        "gecko_profile_startup",
114        "preferences",
115        "xperf_counters",
116        "xperf_providers",
117        "xperf_user_providers",
118        "xperf_stackwalk",
119        "tpmozafterpaint",
120        "fnbpaint",
121        "tphero",
122        "tpmanifest",
123        "profile",
124        "firstpaint",
125        "userready",
126        "testeventmap",
127        "base_vs_ref",
128        "extensions",
129        "filters",
130        "setup",
131        "cleanup",
132        "webextensions",
133        "webextensions_folder",
134        "reinstall",  # A list of files from the profile directory that
135        # should be copied to the temporary profile prior to
136        # running each cycle, to avoid one cycle overwriting
137        # the data used by the next another cycle (may be used
138        # e.g. for sessionstore.js to ensure that all cycles
139        # use the exact same sessionstore.js, rather than a
140        # more recent copy).
141    ]
142
143    def __init__(self, **kw):
144        super(TsBase, self).__init__(**kw)
145
146        # Unless set to False explicitly, all TsBase tests will have the blocklist
147        # enabled by default in order to more accurately test the startup paths.
148        BLOCKLIST_PREF = "extensions.blocklist.enabled"
149
150        if not hasattr(self, "preferences"):
151            self.preferences = {
152                BLOCKLIST_PREF: True,
153            }
154        elif BLOCKLIST_PREF not in self.preferences:
155            self.preferences[BLOCKLIST_PREF] = True
156
157
158@register_test()
159class ts_paint(TsBase):
160    """
161    Launches tspaint_test.html with the current timestamp in the url,
162    waits for [MozAfterPaint and onLoad] to fire, then records the end
163    time and calculates the time to startup.
164    """
165
166    cycles = 20
167    timeout = 150
168    gecko_profile_startup = True
169    gecko_profile_entries = 10000000
170    url = "startup_test/tspaint_test.html"
171    xperf_counters = []
172    win7_counters = []
173    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
174    tpmozafterpaint = True
175    mainthread = False
176    responsiveness = False
177    unit = "ms"
178
179
180@register_test()
181class ts_paint_webext(ts_paint):
182    webextensions = "${talos}/webextensions/dummy/dummy.xpi"
183    preferences = {"xpinstall.signatures.required": False}
184
185
186@register_test()
187class ts_paint_heavy(ts_paint):
188    """
189    ts_paint test ran against a heavy-user profile
190    """
191
192    profile = "simple"
193
194
195@register_test()
196class ts_paint_flex(ts_paint):
197    preferences = {"layout.css.emulate-moz-box-with-flex": True}
198
199
200@register_test()
201class startup_about_home_paint(ts_paint):
202    """
203    Tests loading about:home on startup with the about:home startup cache
204    disabled, to more accurately simulate startup when the cache does not
205    exist.
206    """
207
208    url = None
209    cycles = 20
210    timeout = 600
211    extensions = ["${talos}/startup_test/startup_about_home_paint/addon"]
212    tpmanifest = "${talos}/startup_test/startup_about_home_paint/startup_about_home_paint.manifest"
213    preferences = {
214        "browser.startup.homepage.abouthome_cache.enabled": False,
215    }
216
217
218@register_test()
219class startup_about_home_paint_cached(ts_paint):
220    """
221    Tests loading about:home on startup with the about:home startup cache
222    enabled.
223    """
224
225    url = None
226    cycles = 20
227    extensions = ["${talos}/startup_test/startup_about_home_paint/addon"]
228    tpmanifest = "${talos}/startup_test/startup_about_home_paint/startup_about_home_paint.manifest"
229    preferences = {
230        "browser.startup.homepage.abouthome_cache.enabled": True,
231    }
232
233
234@register_test()
235class startup_about_home_paint_realworld_webextensions(ts_paint):
236    url = None
237    cycles = 20
238    extensions = [
239        "${talos}/startup_test/startup_about_home_paint/addon",
240        "${talos}/getinfooffline",
241    ]
242    tpmanifest = "${talos}/startup_test/startup_about_home_paint/startup_about_home_paint.manifest"
243    webextensions_folder = "${talos}/webextensions"
244    preferences = {
245        "browser.startup.homepage.abouthome_cache.enabled": False,
246    }
247
248
249@register_test()
250class sessionrestore(TsBase):
251    """
252    A start up test measuring the time it takes to load a sessionstore.js file.
253
254    1. Set up Firefox to restore from a given sessionstore.js file.
255    2. Launch Firefox.
256    3. Measure the delta between firstPaint and sessionRestored.
257    """
258
259    extensions = ["${talos}/startup_test/sessionrestore/addon"]
260    cycles = 10
261    timeout = 900
262    gecko_profile_startup = True
263    gecko_profile_entries = 10000000
264    profile_path = "${talos}/startup_test/sessionrestore/profile"
265    reinstall = ["sessionstore.jsonlz4", "sessionstore.js", "sessionCheckpoints.json"]
266    # Restore the session. We have to provide a URL, otherwise Talos
267    # asks for a manifest URL.
268    url = "about:home"
269    preferences = {"browser.startup.page": 3}
270    unit = "ms"
271
272
273@register_test()
274class sessionrestore_no_auto_restore(sessionrestore):
275    """
276    A start up test measuring the time it takes to load a sessionstore.js file.
277
278    1. Set up Firefox to *not* restore automatically from sessionstore.js file.
279    2. Launch Firefox.
280    3. Measure the delta between firstPaint and sessionRestored.
281    """
282
283    timeout = 300
284    preferences = {
285        "browser.startup.page": 1,
286        "talos.sessionrestore.norestore": True,
287    }
288
289
290@register_test()
291class sessionrestore_many_windows(sessionrestore):
292    """
293    A start up test measuring the time it takes to load a sessionstore.js file.
294
295    1. Set up Firefox to restore automatically from sessionstore.js file.
296    2. Launch Firefox.
297    3. Measure the delta between firstPaint and sessionRestored.
298    """
299
300    profile_path = "${talos}/startup_test/sessionrestore/profile-manywindows"
301
302
303# pageloader tests(tp5, etc)
304
305# The overall test number is determined by first calculating the median
306# page load time for each page in the set (excluding the max page load
307# per individual page). The max median from that set is then excluded and
308# the average is taken; that becomes the number reported to the tinderbox
309# waterfall.
310
311
312class PageloaderTest(Test):
313    """abstract base class for a Talos Pageloader test"""
314
315    extensions = ["${talos}/pageloader"]
316    tpmanifest = None  # test manifest
317    tpcycles = 1  # number of time to run each page
318    cycles = None
319    timeout = None
320
321    keys = [
322        "tpmanifest",
323        "tpcycles",
324        "tppagecycles",
325        "tprender",
326        "tpchrome",
327        "tpmozafterpaint",
328        "fnbpaint",
329        "tphero",
330        "tploadnocache",
331        "firstpaint",
332        "userready",
333        "testeventmap",
334        "base_vs_ref",
335        "mainthread",
336        "resolution",
337        "cycles",
338        "gecko_profile",
339        "gecko_profile_interval",
340        "gecko_profile_entries",
341        "gecko_profile_features",
342        "gecko_profile_threads",
343        "tptimeout",
344        "win_counters",
345        "w7_counters",
346        "linux_counters",
347        "mac_counters",
348        "tpscrolltest",
349        "xperf_counters",
350        "timeout",
351        "responsiveness",
352        "profile_path",
353        "xperf_providers",
354        "xperf_user_providers",
355        "xperf_stackwalk",
356        "format_pagename",
357        "filters",
358        "preferences",
359        "extensions",
360        "setup",
361        "cleanup",
362        "lower_is_better",
363        "alert_threshold",
364        "unit",
365        "webextensions",
366        "profile",
367        "suite_should_alert",
368        "subtest_alerts",
369        "perfherder_framework",
370        "pdfpaint",
371        "webextensions_folder",
372        "a11y",
373    ]
374
375
376class QuantumPageloadTest(PageloaderTest):
377    """
378    Base class for a Quantum Pageload test
379    """
380
381    tpcycles = 1
382    tppagecycles = 25
383    gecko_profile_interval = 1
384    gecko_profile_entries = 2000000
385    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
386    unit = "ms"
387    lower_is_better = True
388    fnbpaint = True
389
390
391@register_test()
392class twinopen(PageloaderTest):
393    """
394    Tests the amount of time it takes an open browser to open a new browser
395    window and paint the browser chrome. This test does not include startup
396    time. Multiple test windows are opened in succession.
397    (Measures ctrl-n performance.)
398    """
399
400    extensions = ["${talos}/pageloader", "${talos}/tests/twinopen"]
401    tpmanifest = "${talos}/tests/twinopen/twinopen.manifest"
402    tppagecycles = 20
403    timeout = 300
404    gecko_profile_interval = 1
405    gecko_profile_entries = 2000000
406    tpmozafterpaint = True
407    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
408    unit = "ms"
409    preferences = {"browser.startup.homepage": "about:blank"}
410
411
412@register_test()
413class pdfpaint(PageloaderTest):
414    """
415    Tests the amount of time it takes for the the first page of a PDF to
416    be rendered.
417    """
418
419    tpmanifest = "${talos}/tests/pdfpaint/pdfpaint.manifest"
420    tppagecycles = 20
421    timeout = 600
422    gecko_profile_entries = 1000000
423    pdfpaint = True
424    unit = "ms"
425    preferences = {"pdfjs.eventBusDispatchToDOM": True}
426
427
428@register_test()
429class cpstartup(PageloaderTest):
430    """
431    Tests the amount of time it takes to start up a new content process and
432    initialize it to the point where it can start processing incoming URLs
433    to load.
434    """
435
436    extensions = ["${talos}/pageloader", "${talos}/tests/cpstartup/extension"]
437    tpmanifest = "${talos}/tests/cpstartup/cpstartup.manifest"
438    tppagecycles = 20
439    timeout = 600
440    gecko_profile_entries = 1000000
441    tploadnocache = True
442    unit = "ms"
443    preferences = {
444        # By default, Talos is configured to open links from
445        # content in new windows. We're overriding them so that
446        # they open in new tabs instead.
447        # See http://kb.mozillazine.org/Browser.link.open_newwindow
448        # and http://kb.mozillazine.org/Browser.link.open_newwindow.restriction
449        "browser.link.open_newwindow": 3,
450        "browser.link.open_newwindow.restriction": 2,
451    }
452
453
454@register_test()
455class tabpaint(PageloaderTest):
456    """
457    Tests the amount of time it takes to open new tabs, triggered from
458    both the parent process and the content process.
459    """
460
461    extensions = ["${talos}/tests/tabpaint", "${talos}/pageloader"]
462    tpmanifest = "${talos}/tests/tabpaint/tabpaint.manifest"
463    tppagecycles = 20
464    timeout = 600
465    gecko_profile_entries = 1000000
466    tploadnocache = True
467    unit = "ms"
468    preferences = {
469        # By default, Talos is configured to open links from
470        # content in new windows. We're overriding them so that
471        # they open in new tabs instead.
472        # See http://kb.mozillazine.org/Browser.link.open_newwindow
473        # and http://kb.mozillazine.org/Browser.link.open_newwindow.restriction
474        "browser.link.open_newwindow": 3,
475        "browser.link.open_newwindow.restriction": 2,
476        "browser.newtab.preload": False,
477    }
478
479
480@register_test()
481class tabswitch(PageloaderTest):
482    """
483    Tests the amount of time it takes to switch between tabs
484    """
485
486    extensions = ["${talos}/tests/tabswitch", "${talos}/pageloader"]
487    tpmanifest = "${talos}/tests/tabswitch/tabswitch.manifest"
488    tppagecycles = 5
489    timeout = 900
490    gecko_profile_entries = 5000000
491    tploadnocache = True
492    preferences = {
493        "addon.test.tabswitch.urlfile": os.path.join("${talos}", "tests", "tp5o.html"),
494        "addon.test.tabswitch.webserver": "${webserver}",
495        "addon.test.tabswitch.maxurls": -1,
496        # Avoid the bookmarks toolbar interfering with our measurements.
497        # See bug 1674053 and bug 1675809 for context.
498        "browser.toolbars.bookmarks.visibility": "never",
499    }
500    unit = "ms"
501
502
503@register_test()
504class cross_origin_pageload(PageloaderTest):
505    """
506    Tests the amount of time it takes to load a page which
507    has 20 cross origin iframes
508    """
509
510    preferences = {"dom.ipc.processPrelaunch.fission.number": 30}
511    extensions = ["${talos}/pageloader"]
512    tpmanifest = "${talos}/tests/cross_origin_pageload/cross_origin_pageload.manifest"
513    tppagecycles = 10
514    timeout = 100
515    tploadnocache = True
516    unit = "ms"
517
518
519@register_test()
520class tart(PageloaderTest):
521    """
522    Tab Animation Regression Test
523    Tests tab animation on these cases:
524    1. Simple: single new tab of about:blank open/close without affecting
525       (shrinking/expanding) other tabs.
526    2. icon: same as above with favicons and long title instead of about:blank.
527    3. Newtab: newtab open with thumbnails preview - without affecting other
528       tabs, with and without preload.
529    4. Fade: opens a tab, then measures fadeout/fadein (tab animation without
530       the overhead of opening/closing a tab).
531    - Case 1 is tested with DPI scaling of 1.
532    - Case 2 is tested with DPI scaling of 1.0 and 2.0.
533    - Case 3 is tested with the default scaling of the test system.
534    - Case 4 is tested with DPI scaling of 2.0 with the "icon" tab
535      (favicon and long title).
536    - Each animation produces 3 test results:
537      - error: difference between the designated duration and the actual
538        completion duration from the trigger.
539      - half: average interval over the 2nd half of the animation.
540      - all: average interval over all recorded intervals.
541    """
542
543    tpmanifest = "${talos}/tests/tart/tart.manifest"
544    extensions = ["${talos}/pageloader", "${talos}/tests/tart/addon"]
545    tpcycles = 1
546    tppagecycles = 25
547    tploadnocache = True
548    tpmozafterpaint = False
549    gecko_profile_interval = 10
550    gecko_profile_entries = 1000000
551    win_counters = w7_counters = linux_counters = mac_counters = None
552    """
553    ASAP mode
554    The recording API is broken with OMTC before ~2013-11-27
555    After ~2013-11-27, disabling OMTC will also implicitly disable
556    OGL HW composition to disable OMTC with older firefox builds, also
557    set 'layers.offmainthreadcomposition.enabled': False
558    """
559    preferences = {
560        "layout.frame_rate": 0,
561        "docshell.event_starvation_delay_hint": 1,
562        "dom.send_after_paint_to_content": False,
563    }
564    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
565    unit = "ms"
566
567
568@register_test()
569class tart_flex(tart):
570    preferences = {"layout.css.emulate-moz-box-with-flex": True}
571
572
573@register_test()
574class damp(PageloaderTest):
575    """
576    Devtools At Maximum Performance
577    Tests the speed of DevTools toolbox open, close, and page reload
578    for each tool, across a very simple and very complicated page.
579    """
580
581    tpmanifest = "${talos}/tests/devtools/damp.manifest"
582    extensions = ["${talos}/pageloader", "${talos}/tests/devtools/addon"]
583    cycles = 5
584    tpcycles = 1
585    tppagecycles = 5
586    tploadnocache = True
587    tpmozafterpaint = False
588    gecko_profile_interval = 10
589    gecko_profile_entries = 10000000
590    win_counters = w7_counters = linux_counters = mac_counters = None
591    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
592    preferences = {"devtools.memory.enabled": True}
593    unit = "ms"
594    subtest_alerts = True
595    perfherder_framework = "devtools"
596
597
598@register_test()
599class glterrain(PageloaderTest):
600    """
601    Simple rotating WebGL scene with moving light source over a
602    textured terrain.
603    Measures average frame intervals.
604    The same sequence is measured 4 times for combinations of alpha and
605    antialias as canvas properties.
606    Each of these 4 runs is reported as a different test name.
607    """
608
609    tpmanifest = "${talos}/tests/webgl/glterrain.manifest"
610    tpcycles = 1
611    tppagecycles = 25
612    tploadnocache = True
613    tpmozafterpaint = False
614    tpchrome = False
615    timeout = 600
616    gecko_profile_interval = 10
617    gecko_profile_entries = 2000000
618    win_counters = w7_counters = linux_counters = mac_counters = None
619    """ ASAP mode """
620    preferences = {
621        "layout.frame_rate": 0,
622        "docshell.event_starvation_delay_hint": 1,
623        "dom.send_after_paint_to_content": False,
624    }
625    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
626    unit = "frame interval"
627
628
629@register_test()
630class glvideo(PageloaderTest):
631    """
632    WebGL video texture update with 1080p video.
633    Measures mean tick time across 100 ticks.
634    (each tick is texImage2D(<video>)+setTimeout(0))
635    """
636
637    tpmanifest = "${talos}/tests/webgl/glvideo.manifest"
638    tpcycles = 1
639    tppagecycles = 5
640    tploadnocache = True
641    tpmozafterpaint = False
642    tpchrome = False
643    timeout = 600
644    gecko_profile_interval = 2
645    gecko_profile_entries = 2000000
646    win_counters = w7_counters = linux_counters = mac_counters = None
647    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
648    unit = "ms"
649
650
651@register_test()
652class tp5n(PageloaderTest):
653    """
654    Tests the time it takes Firefox to load the tp5 web page test set.
655
656    The tp5 is an updated web page test set to 100 pages from April 8th, 2011.
657    Effort was made for the pages to no longer be splash screens/login
658    pages/home pages but to be pages that better reflect the actual content
659    of the site in question.
660    """
661
662    resolution = 20
663    multidomain = True
664    tpmanifest = "${talos}/fis/tp5n/tp5n.manifest"
665    tpcycles = 1
666    tppagecycles = 1
667    cycles = 1
668    tpmozafterpaint = True
669    tptimeout = 10000
670    mainthread = True
671    w7_counters = []
672    win_counters = []
673    linux_counters = []
674    mac_counters = []
675    xperf_counters = [
676        "main_startup_fileio",
677        "main_startup_netio",
678        "main_normal_fileio",
679        "main_normal_netio",
680        "nonmain_startup_fileio",
681        "nonmain_normal_fileio",
682        "nonmain_normal_netio",
683        "mainthread_readcount",
684        "mainthread_readbytes",
685        "mainthread_writecount",
686        "mainthread_writebytes",
687        "time_to_session_store_window_restored_ms",
688    ]
689    xperf_providers = [
690        "PROC_THREAD",
691        "LOADER",
692        "HARD_FAULTS",
693        "FILENAME",
694        "FILE_IO",
695        "FILE_IO_INIT",
696    ]
697    xperf_user_providers = ["Mozilla Generic Provider", "Microsoft-Windows-TCPIP"]
698    xperf_stackwalk = ["FileCreate", "FileRead", "FileWrite", "FileFlush", "FileClose"]
699    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
700    timeout = 1800
701    setup = "${talos}/xtalos/start_xperf.py -c ${talos}/bcontroller.json"
702    cleanup = "${talos}/xtalos/parse_xperf.py -c ${talos}/bcontroller.json"
703    preferences = {
704        "extensions.enabledScopes": "",
705        "talos.logfile": "browser_output.txt",
706    }
707    unit = "ms"
708
709
710@register_test()
711class tp5o(PageloaderTest):
712    """
713    Derived from the tp5n pageset, this is the 49 most reliable webpages.
714    """
715
716    tpcycles = 1
717    tppagecycles = 25
718    cycles = 1
719    tpmozafterpaint = True
720    tptimeout = 5000
721    mainthread = False
722    multidomain = True
723    tpmanifest = "${talos}/fis/tp5n/tp5o.manifest"
724    win_counters = ["% Processor Time"]
725    w7_counters = ["% Processor Time"]
726    linux_counters = ["XRes"]
727    mac_counters = []
728    responsiveness = True
729    gecko_profile_interval = 2
730    gecko_profile_entries = 4000000
731    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
732    timeout = 1800
733    unit = "ms"
734
735
736@register_test()
737class tp5o_webext(tp5o):
738    webextensions = "${talos}/webextensions/dummy/dummy.xpi"
739    preferences = {"xpinstall.signatures.required": False}
740
741
742@register_test()
743class tp5o_scroll(PageloaderTest):
744    """
745    Tests scroll (like tscrollx does, including ASAP) but on the tp5o pageset.
746    """
747
748    tpmanifest = "${talos}/tests/tp5n/tp5o.manifest"
749    tpcycles = 1
750    tppagecycles = 12
751    gecko_profile_interval = 2
752    gecko_profile_entries = 2000000
753    tpscrolltest = True
754    """ASAP mode"""
755    tpmozafterpaint = False
756    preferences = {
757        "layout.frame_rate": 0,
758        "docshell.event_starvation_delay_hint": 1,
759        "dom.send_after_paint_to_content": True,
760        "apz.paint_skipping.enabled": False,
761        "layout.css.scroll-behavior.spring-constant": "'10'",
762        "toolkit.framesRecording.bufferSize": 10000,
763    }
764    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
765    unit = "1/FPS"
766
767
768@register_test()
769class v8_7(PageloaderTest):
770    """
771    This is the V8 (version 7) javascript benchmark taken verbatim and
772    slightly modified to fit into our pageloader extension and talos harness.
773
774    The previous version of this test is V8 version 5 which was run on
775    selective branches and operating systems.
776    """
777
778    tpmanifest = "${talos}/tests/v8_7/v8.manifest"
779    gecko_profile_interval = 1
780    gecko_profile_entries = 1000000
781    tpcycles = 1
782    resolution = 20
783    tpmozafterpaint = False
784    preferences = {"dom.send_after_paint_to_content": False}
785    filters = filter.v8_subtest.prepare()
786    unit = "score"
787    lower_is_better = False
788
789
790@register_test()
791class kraken(PageloaderTest):
792    """
793    This is the Kraken javascript benchmark taken verbatim and slightly
794    modified to fit into our pageloader extension and talos harness.
795    """
796
797    tpmanifest = "${talos}/tests/kraken/kraken.manifest"
798    tpcycles = 1
799    tppagecycles = 1
800    gecko_profile_interval = 1
801    gecko_profile_entries = 5000000
802    tpmozafterpaint = False
803    tpchrome = False
804    preferences = {"dom.send_after_paint_to_content": False}
805    filters = filter.mean.prepare()
806    unit = "score"
807
808
809@register_test()
810class basic_compositor_video(PageloaderTest):
811    """
812    Video test
813    """
814
815    tpmanifest = "${talos}/tests/video/video.manifest"
816    tpcycles = 1
817    tppagecycles = 12
818    tpchrome = False
819    timeout = 10000
820    gecko_profile_interval = 1
821    gecko_profile_entries = 2000000
822    preferences = {
823        "full-screen-api.allow-trusted-requests-only": False,
824        "layers.acceleration.force-enabled": False,
825        "layers.acceleration.disabled": True,
826        "gfx.webrender.software": True,
827        "layout.frame_rate": 0,
828        "docshell.event_starvation_delay_hint": 1,
829        "full-screen-api.warning.timeout": 500,
830        "media.ruin-av-sync.enabled": True,
831    }
832    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
833    unit = "ms/frame"
834    lower_is_better = True
835
836
837class dromaeo(PageloaderTest):
838    """abstract base class for dramaeo tests"""
839
840    filters = filter.dromaeo.prepare()
841    lower_is_better = False
842    alert_threshold = 5.0
843    tpchrome = False
844
845
846@register_test()
847class dromaeo_css(dromaeo):
848    """
849    Dromaeo suite of tests for JavaScript performance testing.
850    See the Dromaeo wiki (https://wiki.mozilla.org/Dromaeo)
851    for more information.
852
853    Each page in the manifest is part of the dromaemo css benchmark.
854    """
855
856    gecko_profile_interval = 2
857    gecko_profile_entries = 10000000
858    tpmanifest = "${talos}/tests/dromaeo/css.manifest"
859    unit = "score"
860
861
862@register_test()
863class dromaeo_dom(dromaeo):
864    """
865    Dromaeo suite of tests for JavaScript performance testing.
866    See the Dromaeo wiki (https://wiki.mozilla.org/Dromaeo)
867    for more information.
868
869    Each page in the manifest is part of the dromaemo dom benchmark.
870    """
871
872    gecko_profile_interval = 2
873    gecko_profile_entries = 10000000
874    tpmanifest = "${talos}/tests/dromaeo/dom.manifest"
875    unit = "score"
876
877
878@register_test()
879class tresize(PageloaderTest):
880    """
881    This test does some resize thing.
882    """
883
884    tpmanifest = "${talos}/tests/tresize/tresize.manifest"
885    extensions = ["${talos}/pageloader", "${talos}/tests/tresize/addon"]
886    tppagecycles = 20
887    timeout = 900
888    gecko_profile_interval = 2
889    gecko_profile_entries = 1000000
890    tpmozafterpaint = True
891    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
892    unit = "ms"
893
894
895@register_test()
896class tsvgm(PageloaderTest):
897    """
898    An svg-only number that measures SVG rendering performance
899    for dynamic content only.
900    """
901
902    tpmanifest = "${talos}/tests/svgx/svgm.manifest"
903    tpcycles = 1
904    tppagecycles = 7
905    tpmozafterpaint = False
906    tpchrome = False
907    gecko_profile_interval = 10
908    gecko_profile_entries = 1000000
909    """ASAP mode"""
910    preferences = {
911        "layout.frame_rate": 0,
912        "docshell.event_starvation_delay_hint": 1,
913        "dom.send_after_paint_to_content": False,
914    }
915    filters = filter.ignore_first.prepare(2) + filter.median.prepare()
916    unit = "ms"
917
918
919@register_test()
920class tsvgx(PageloaderTest):
921    """
922    An svg-only number that measures SVG rendering performance
923    for dynamic content only.
924    """
925
926    tpmanifest = "${talos}/tests/svgx/svgx.manifest"
927    tpcycles = 1
928    tppagecycles = 25
929    tpmozafterpaint = False
930    tpchrome = False
931    timeout = 600
932    gecko_profile_interval = 10
933    gecko_profile_entries = 1000000
934    """ASAP mode"""
935    preferences = {
936        "layout.frame_rate": 0,
937        "docshell.event_starvation_delay_hint": 1,
938        "dom.send_after_paint_to_content": False,
939    }
940    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
941    unit = "ms"
942
943
944@register_test()
945class tsvg_static(PageloaderTest):
946    """
947    An svg-only number that measures SVG rendering performance
948    for static content only.
949    """
950
951    tpmanifest = "${talos}/tests/svg_static/svg_static.manifest"
952    tpcycles = 1
953    tppagecycles = 25
954    tpmozafterpaint = True
955    tpchrome = False
956    timeout = 600
957    gecko_profile_interval = 1
958    gecko_profile_entries = 10000000
959    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
960    unit = "ms"
961
962
963@register_test()
964class tsvgr_opacity(PageloaderTest):
965    """
966    An svg-only number that measures SVG rendering performance.
967    """
968
969    tpmanifest = "${talos}/tests/svg_opacity/svg_opacity.manifest"
970    tpcycles = 1
971    tppagecycles = 25
972    tpmozafterpaint = True
973    tpchrome = False
974    timeout = 600
975    gecko_profile_interval = 1
976    gecko_profile_entries = 10000000
977    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
978    unit = "ms"
979
980
981@register_test()
982class tscrollx(PageloaderTest):
983    """
984    This test does some scrolly thing.
985    """
986
987    tpmanifest = "${talos}/tests/scroll/scroll.manifest"
988    tpcycles = 1
989    tppagecycles = 25
990    tpmozafterpaint = False
991    tpchrome = False
992    timeout = 600
993    gecko_profile_interval = 1
994    gecko_profile_entries = 1000000
995    """ ASAP mode """
996    preferences = {
997        "layout.frame_rate": 0,
998        "docshell.event_starvation_delay_hint": 1,
999        "dom.send_after_paint_to_content": True,
1000        "apz.paint_skipping.enabled": False,
1001        "layout.css.scroll-behavior.spring-constant": "'10'",
1002        "toolkit.framesRecording.bufferSize": 10000,
1003    }
1004    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
1005    unit = "ms"
1006
1007
1008@register_test()
1009class a11yr(PageloaderTest):
1010    """
1011    This test ensures basic a11y tables and permutations do not cause
1012    performance regressions.
1013    """
1014
1015    tpmanifest = "${talos}/tests/a11y/a11y.manifest"
1016    tpcycles = 1
1017    tppagecycles = 25
1018    tpmozafterpaint = True
1019    tpchrome = False
1020    timeout = 600
1021    preferences = {"dom.send_after_paint_to_content": False}
1022    unit = "ms"
1023    alert_threshold = 5.0
1024    a11y = True
1025
1026
1027class WebkitBenchmark(PageloaderTest):
1028    tpcycles = 1
1029    tppagecycles = 5
1030    tpmozafterpaint = False
1031    tpchrome = False
1032    format_pagename = False
1033    lower_is_better = False
1034    unit = "score"
1035
1036
1037@register_test()
1038class stylebench(WebkitBenchmark):
1039    # StyleBench benchmark used by many browser vendors (from webkit)
1040    tpmanifest = "${talos}/tests/stylebench/stylebench.manifest"
1041
1042
1043@register_test()
1044class motionmark_animometer(WebkitBenchmark):
1045    # MotionMark benchmark used by many browser vendors (from webkit)
1046    tpmanifest = "${talos}/tests/motionmark/animometer.manifest"
1047
1048
1049@register_test()
1050class motionmark_webgl(WebkitBenchmark):
1051    # MotionMark benchmark used by many browser vendors (from webkit)
1052    tpmanifest = "${talos}/tests/motionmark/webgl.manifest"
1053    unit = "fps"
1054    timeout = 600
1055
1056
1057@register_test()
1058class ARES6(WebkitBenchmark):
1059    # ARES-6 benchmark used by many browser vendors (from webkit)
1060    tpmanifest = "${talos}/tests/ares6/ares6.manifest"
1061    tppagecycles = 1
1062    lower_is_better = True
1063
1064
1065@register_test()
1066class motionmark_htmlsuite(WebkitBenchmark):
1067    # MotionMark benchmark used by many browser vendors (from webkit)
1068    tpmanifest = "${talos}/tests/motionmark/htmlsuite.manifest"
1069
1070
1071@register_test()
1072class JetStream(WebkitBenchmark):
1073    # JetStream benchmark used by many browser vendors (from webkit)
1074    tpmanifest = "${talos}/tests/jetstream/jetstream.manifest"
1075    tppagecycles = 1
1076
1077
1078@register_test()
1079class perf_reftest(PageloaderTest):
1080    """
1081    Style perf-reftest a set of tests where the result is the difference of base vs ref pages
1082    """
1083
1084    base_vs_ref = (
1085        True  # compare the two test pages with eachother and report comparison
1086    )
1087    tpmanifest = "${talos}/tests/perf-reftest/perf_reftest.manifest"
1088    tpcycles = 1
1089    tppagecycles = 10
1090    tptimeout = 30000
1091    gecko_profile_interval = 1
1092    gecko_profile_entries = 2000000
1093    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
1094    unit = "ms"
1095    lower_is_better = True
1096    alert_threshold = 5.0
1097    subtest_alerts = True
1098
1099
1100@register_test()
1101class perf_reftest_singletons(PageloaderTest):
1102    """
1103    Style perf-reftests run as individual tests
1104    """
1105
1106    tpmanifest = (
1107        "${talos}/tests/perf-reftest-singletons/perf_reftest_singletons.manifest"
1108    )
1109    tpcycles = 1
1110    tppagecycles = 15
1111    tptimeout = 30000
1112    gecko_profile_interval = 1
1113    gecko_profile_entries = 2000000
1114    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
1115    unit = "ms"
1116    lower_is_better = True
1117    alert_threshold = 5.0
1118    subtest_alerts = True
1119    suite_should_alert = False
1120
1121
1122@register_test()
1123class displaylist_mutate(PageloaderTest):
1124    """
1125    Test modifying single items in a large display list. Measure transaction speed
1126    to the compositor.
1127    """
1128
1129    tpmanifest = "${talos}/tests/layout/displaylist_mutate.manifest"
1130    tpcycles = 1
1131    tppagecycles = 5
1132    tploadnocache = True
1133    tpmozafterpaint = False
1134    tpchrome = False
1135    timeout = 600
1136    gecko_profile_interval = 2
1137    gecko_profile_entries = 2000000
1138    win_counters = w7_counters = linux_counters = mac_counters = None
1139    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
1140    """ASAP mode"""
1141    preferences = {
1142        "layout.frame_rate": 0,
1143        "docshell.event_starvation_delay_hint": 1,
1144        "dom.send_after_paint_to_content": False,
1145    }
1146    unit = "ms"
1147
1148
1149@register_test()
1150class rasterflood_svg(PageloaderTest):
1151    """
1152    Test modifying single items in a large display list. Measure transaction speed
1153    to the compositor.
1154    """
1155
1156    tpmanifest = "${talos}/tests/gfx/rasterflood_svg.manifest"
1157    tpcycles = 1
1158    tppagecycles = 10
1159    tploadnocache = True
1160    tpmozafterpaint = False
1161    tpchrome = False
1162    timeout = 600
1163    gecko_profile_interval = 2
1164    gecko_profile_entries = 2000000
1165    win_counters = w7_counters = linux_counters = mac_counters = None
1166    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
1167    """ASAP mode"""
1168    preferences = {
1169        "layout.frame_rate": 0,
1170        "docshell.event_starvation_delay_hint": 1,
1171        "dom.send_after_paint_to_content": False,
1172    }
1173    unit = "ms"
1174
1175
1176@register_test()
1177class rasterflood_gradient(PageloaderTest):
1178    """
1179    Test expensive rasterization while the main thread is busy.
1180    """
1181
1182    tpmanifest = "${talos}/tests/gfx/rasterflood_gradient.manifest"
1183    tpcycles = 1
1184    tppagecycles = 10
1185    tploadnocache = True
1186    tpmozafterpaint = False
1187    tpchrome = False
1188    timeout = 600
1189    gecko_profile_interval = 2
1190    gecko_profile_entries = 2000000
1191    win_counters = w7_counters = linux_counters = mac_counters = None
1192    filters = filter.ignore_first.prepare(1) + filter.median.prepare()
1193    """ASAP mode"""
1194    preferences = {
1195        "layout.frame_rate": 0,
1196        "docshell.event_starvation_delay_hint": 1,
1197        "dom.send_after_paint_to_content": False,
1198    }
1199    lower_is_better = False
1200    unit = "score"
1201
1202
1203@register_test()
1204class about_preferences_basic(PageloaderTest):
1205    """
1206    Base class for about_preferences test
1207    """
1208
1209    tpmanifest = "${talos}/tests/about-preferences/about_preferences_basic.manifest"
1210    # this test uses 'about:blank' as a dummy page (see manifest) so that the pages
1211    # that just change url categories (i.e. about:preferences#search) will get a load event
1212    # also any of the url category pages cannot have more than one tppagecycle
1213    tpcycles = 25
1214    tppagecycles = 1
1215    gecko_profile_interval = 1
1216    gecko_profile_entries = 2000000
1217    filters = filter.ignore_first.prepare(5) + filter.median.prepare()
1218    unit = "ms"
1219    lower_is_better = True
1220    fnbpaint = True
1221