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

Unified Diff: tracing/tracing/metrics/v8/utils_test.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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/metrics/v8/utils.html ('k') | tracing/tracing/metrics/v8/v8_metrics.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/metrics/v8/utils_test.html
diff --git a/tracing/tracing/metrics/v8/utils_test.html b/tracing/tracing/metrics/v8/utils_test.html
index d5068a16c527a7487e4d338771de56562c065e2a..775de11e7027118b02392425cfecd69b42da8988 100644
--- a/tracing/tracing/metrics/v8/utils_test.html
+++ b/tracing/tracing/metrics/v8/utils_test.html
@@ -5,7 +5,9 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
+<link rel="import" href="/tracing/core/test_utils.html">
<link rel="import" href="/tracing/metrics/v8/utils.html">
+<link rel="import" href="/tracing/model/memory_dump_test_utils.html">
<script>
'use strict';
@@ -141,5 +143,34 @@ tr.b.unittest.testSuite(function() {
assert.closeTo(expected.percentile(0.9), actual.percentile(0.9), 1e-3);
});
+ function addDumpWithAllocator(model, process, allocator, start) {
+ var gmd = tr.model.MemoryDumpTestUtils.addGlobalMemoryDump(
+ model, {ts: start});
+ var pmd = tr.model.MemoryDumpTestUtils.addProcessMemoryDump(gmd, process);
+ pmd.memoryAllocatorDumps =
+ [tr.model.MemoryDumpTestUtils.newAllocatorDump(pmd, allocator)];
+ }
+
+ test('rangeForMemoryDumps', function() {
+ var model = tr.c.TestUtils.newModel(function(model) {
+ var process = model.getOrCreateProcess(1);
+ addDumpWithAllocator(model, process, 'dummy', 10);
+ addDumpWithAllocator(model, process, 'v8', 20);
+ });
+ var range = tr.metrics.v8.utils.rangeForMemoryDumps(model);
+ assert.isFalse(range.isEmpty);
+ assert.strictEqual(range.min, 20);
+ assert.strictEqual(range.max, Infinity);
+ });
+
+ test('rangeForMemoryDumpsEmpty', function() {
+ var model = tr.c.TestUtils.newModel(function(model) {
+ var process = model.getOrCreateProcess(1);
+ addDumpWithAllocator(model, process, 'dummy', 10);
+ addDumpWithAllocator(model, process, 'dummy', 20);
+ });
+ var range = tr.metrics.v8.utils.rangeForMemoryDumps(model);
+ assert.isTrue(range.isEmpty);
+ });
});
</script>
« no previous file with comments | « tracing/tracing/metrics/v8/utils.html ('k') | tracing/tracing/metrics/v8/v8_metrics.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698