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

Unified Diff: tracing/tracing/base/utils_test.html

Issue 2711623002: Add a TBMv2 webrtc_rendering_metric. (Closed)
Patch Set: Addressed comments. Started writing 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
Index: tracing/tracing/base/utils_test.html
diff --git a/tracing/tracing/base/utils_test.html b/tracing/tracing/base/utils_test.html
index 8e7c91a7fceb57231f766e86c90dc45b4e7ccc64..c83076829e6088e6ddf2f3fc318428850a1093b3 100644
--- a/tracing/tracing/base/utils_test.html
+++ b/tracing/tracing/base/utils_test.html
@@ -29,5 +29,43 @@ tr.b.unittest.testSuite(function() {
test('formatDate', function() {
assert.strictEqual(tr.b.formatDate(new Date(0)), '1970-01-01 00:00:00');
});
+
+ test('runLengthEncoding', function() {
+ assert.deepEqual(tr.b.runLengthEncoding([]), []);
+ assert.deepEqual(
+ tr.b.runLengthEncoding([1, 1]),
+ [{
+ value: 1,
+ count: 2,
+ }]);
+ assert.deepEqual(
+ tr.b.runLengthEncoding([1, 2]),
+ [{
+ value: 1,
+ count: 1,
+ },
+ {
+ value: 2,
+ count: 1,
+ }]);
+ assert.deepEqual(
+ tr.b.runLengthEncoding([1, 1, 2, 2, 2, 3, 4, 4]),
+ [{
+ value: 1,
+ count: 2,
+ },
+ {
+ value: 2,
+ count: 3,
+ },
+ {
+ value: 3,
+ count: 1,
+ },
+ {
+ value: 4,
+ count: 2,
+ }]);
+ });
});
</script>

Powered by Google App Engine
This is Rietveld 408576698