Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(481)

Unified Diff: tracing/tracing/extras/chrome/estimated_input_latency_test.html

Issue 2713043003: Fix the task overlap check in maxExpectedQueueingTimeInSlidingWindow. (Closed)
Patch Set: Add tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/extras/chrome/estimated_input_latency.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/extras/chrome/estimated_input_latency_test.html
diff --git a/tracing/tracing/extras/chrome/estimated_input_latency_test.html b/tracing/tracing/extras/chrome/estimated_input_latency_test.html
index baaad307530d1820a8354b8558c5fb43471e8211..896751195d8ca18e4b0fed32352b6943e86d44fd 100644
--- a/tracing/tracing/extras/chrome/estimated_input_latency_test.html
+++ b/tracing/tracing/extras/chrome/estimated_input_latency_test.html
@@ -302,11 +302,28 @@ tr.b.unittest.testSuite(function() {
]),
1e-6);
assert.throws(() => maxExpectedQueueingTimeInSlidingWindow(0, 10, 100,
- [{start: 0, end: 100}]));
+ [{start: 0, end: 100}]),
+ 'The sliding window must fit in the specified time range'
+ );
assert.throws(() => maxExpectedQueueingTimeInSlidingWindow(0, 10, 0,
- [{start: 0, end: 100}]));
+ [{start: 0, end: 100}]),
+ 'The window size must be positive number'
+ );
assert.throws(() => maxExpectedQueueingTimeInSlidingWindow(0, 100, 10,
- [{start: 0, end: 100}, {start: 99, end: 101}]));
+ [{start: 0, end: 100}, {start: 99, end: 101}]),
+ 'Tasks must not overlap'
+ );
+ // Allow small floating-point precision error when comparing task
+ // end-points for overlaping.
+ assert.closeTo((100.0001 + 0.0001) / 2,
charliea (OOO until 10-5) 2017/02/24 21:22:01 General comment: there are a bunch of different be
ulan 2017/02/24 21:28:11 Thank you. As discussed online, I'll refactor this
+ maxExpectedQueueingTimeInSlidingWindow(0, 1000, 100,
+ [{start: 0, end: 100.0001}, {start: 100.0, end: 200}]),
+ 1e-6);
+ // Overlap larger than 1e-3 should trigger exception.
+ assert.throws(() => maxExpectedQueueingTimeInSlidingWindow(0, 100, 10,
+ [{start: 0, end: 100.0011}, {start: 100.0, end: 101}]),
+ 'Tasks must not overlap'
+ );
});
});
</script>
« no previous file with comments | « tracing/tracing/extras/chrome/estimated_input_latency.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698