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

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

Issue 2711623002: Add a TBMv2 webrtc_rendering_metric. (Closed)
Patch Set: Customize summary options. Created 3 years, 9 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..5f8ff665169f7036c6657e7520c40b20c055157a 100644
--- a/tracing/tracing/base/utils_test.html
+++ b/tracing/tracing/base/utils_test.html
@@ -29,5 +29,21 @@ 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([]), []);
+
+ var encoded = tr.b.runLengthEncoding([1, 1]);
+ assert.deepEqual(encoded.map(x => x.value), [1]);
+ assert.deepEqual(encoded.map(x => x.count), [2]);
+
+ encoded = tr.b.runLengthEncoding([1, 2]);
+ assert.deepEqual(encoded.map(x => x.value), [1, 2]);
+ assert.deepEqual(encoded.map(x => x.count), [1, 1]);
+
+ encoded = tr.b.runLengthEncoding([1, 1, 2, 2, 2, 3, 1, 1]);
+ assert.deepEqual(encoded.map(x => x.value), [1, 2, 3, 1]);
+ assert.deepEqual(encoded.map(x => x.count), [2, 3, 1, 2]);
+ });
});
</script>

Powered by Google App Engine
This is Rietveld 408576698