Commit 4bd09887 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

[throughput] Add a new test case for extreme janky main thread

This CL adds a new throughput test story, to test the cases where the
main thread is extremely jank, and that the throughput can be 0.

Bug: 1048187
Change-Id: Ifdd44d165652489de8b41965921801894fba86f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134929Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756493}
parent 195035c8
......@@ -34,10 +34,12 @@ const skipEvery = targetMainFps > 0 ? parseInt(60 / targetMainFps) : 0;
const query = window.location.search.substr(1).split('&');
const shouldJank = query.indexOf('jank') >= 0;
const shouldExtremeJank = query.indexOf('extremejank') >= 0;
const offscreen = query.indexOf('offscreen') >= 0;
if (offscreen) {
document.body.style.marginTop = '5000px';
}
const jankAmount = shouldExtremeJank ? 5000 : 16;
var currentValue = 0;
const maxValue = 150;
......@@ -61,9 +63,9 @@ function animateStep() {
if (currentValue <= minValue)
incrementing = true;
}
if (shouldJank) {
if (shouldJank || shouldExtremeJank) {
const now = new Date();
while ((new Date() - now) < 16) {}
while ((new Date() - now) < jankAmount) {}
}
mainanim.style[attributeName] = setProp(currentValue);
}
......
......@@ -112,6 +112,13 @@ class MainSixtyWithJankImplZero(ThroughputMetricStory):
'main-animations-throughput.html?jank#60')
class MainSixtyWithExtremeJankImplZero(ThroughputMetricStory):
BASE_NAME = 'main_60fps_with_extreme_jank_impl_0fps'
SUPPORTED_PLATFORMS = platforms.ALL_PLATFORMS
URL = ('file://../../../../chrome/test/data/perf/throughput_test_cases/'
'main-animations-throughput.html?extremejank#60')
class MainZeroWithJankImplZero(ThroughputMetricStory):
BASE_NAME = 'main_0fps_with_jank_impl_0fps'
SUPPORTED_PLATFORMS = platforms.ALL_PLATFORMS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment