зеркало из https://github.com/mozilla/gecko-dev.git
Add a Talos test for displaylist mutation. (bug 1411804, r=jmaher, r=mattwoodrow)
This commit is contained in:
Родитель
1a4ef6ea87
Коммит
a645a01ee6
|
@ -47,7 +47,7 @@
|
|||
"talos_options": ["--disable-stylo"]
|
||||
},
|
||||
"g4-e10s": {
|
||||
"tests": ["basic_compositor_video", "glvideo"]
|
||||
"tests": ["basic_compositor_video", "glvideo", "displaylist_mutate"]
|
||||
},
|
||||
"g4-stylo-disabled-e10s": {
|
||||
"tests": ["basic_compositor_video", "glvideo"],
|
||||
|
|
|
@ -981,3 +981,25 @@ class tp6_facebook_heavy(tp6_facebook):
|
|||
tp6_facebook test ran against a heavy-user profile
|
||||
"""
|
||||
profile = 'simple'
|
||||
|
||||
@register_test()
|
||||
class displaylist_mutate(PageloaderTest):
|
||||
"""
|
||||
Test modifying single items in a large display list. Measure transaction speed
|
||||
to the compositor.
|
||||
"""
|
||||
tpmanifest = '${talos}/tests/layout/displaylist_mutate.manifest'
|
||||
tpcycles = 1
|
||||
tppagecycles = 5
|
||||
tploadnocache = True
|
||||
tpmozafterpaint = False
|
||||
tpchrome = False
|
||||
gecko_profile_interval = 2
|
||||
gecko_profile_entries = 2000000
|
||||
win_counters = w7_counters = linux_counters = mac_counters = None
|
||||
filters = filter.ignore_first.prepare(1) + filter.median.prepare()
|
||||
"""ASAP mode"""
|
||||
preferences = {'layout.frame_rate': 0,
|
||||
'docshell.event_starvation_delay_hint': 1,
|
||||
'dom.send_after_paint_to_content': False}
|
||||
unit = 'ms'
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
<html>
|
||||
<head>
|
||||
<style>
|
||||
div {
|
||||
width:10px;
|
||||
height:10px;
|
||||
background-color:green;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body id="body">
|
||||
</body>
|
||||
<script>
|
||||
|
||||
var start = null;
|
||||
var divCount = 10000;
|
||||
var maxIterations = 600;
|
||||
|
||||
for (var i = 0; i < divCount; i++) {
|
||||
var div = document.createElement("div");
|
||||
div.id = i;
|
||||
document.getElementById("body").appendChild(div);
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
function runFrame() {
|
||||
if (document.getElementById(i).style.backgroundColor == "red") {
|
||||
document.getElementById(i).style.backgroundColor = "green";
|
||||
} else {
|
||||
document.getElementById(i).style.backgroundColor = "red";
|
||||
}
|
||||
i++;
|
||||
i = i%divCount;
|
||||
if (--maxIterations == 0) {
|
||||
var end = new Date();
|
||||
if (window.tpRecordTime) {
|
||||
window.tpRecordTime(end - start, start);
|
||||
}
|
||||
if (parent.reportResults) {
|
||||
parent.reportResults(end - start, start);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
window.requestAnimationFrame(runFrame);
|
||||
}
|
||||
|
||||
addEventListener("load", function() {
|
||||
try {
|
||||
// Outside of talos, this throws a security exception which no-op this file.
|
||||
// (It's not required nor allowed for addons since Firefox 17)
|
||||
// It's used inside talos from non-privileged pages (like during tscroll),
|
||||
// and it works because talos disables all/most security measures.
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
} catch (e) {}
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
|
||||
|
||||
TalosContentProfiler.resume("displaylist_mutate.html loaded", true).then(() => {
|
||||
start = new Date();
|
||||
window.requestAnimationFrame(runFrame);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
% http://localhost/tests/layout/benchmarks/displaylist_mutate.html
|
Загрузка…
Ссылка в новой задаче