| Index: tracing/tracing/extras/importer/trace_code_entry_test.html
|
| diff --git a/tracing/tracing/extras/importer/trace_code_entry_test.html b/tracing/tracing/extras/importer/trace_code_entry_test.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..39c2c78cb9473077d69c7ef644cf7abe3ac26911
|
| --- /dev/null
|
| +++ b/tracing/tracing/extras/importer/trace_code_entry_test.html
|
| @@ -0,0 +1,105 @@
|
| +<!DOCTYPE html>
|
| +<!--
|
| +Copyright 2015 The Chromium Authors. All rights reserved.
|
| +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/extras/importer/trace_code_entry.html">
|
| +
|
| +<script>
|
| +'use strict';
|
| +
|
| +tr.b.unittest.testSuite(function() {
|
| + test('lazy_compile_method', function() {
|
| + var tce = new tr.e.importer.TraceCodeEntry(10, 'Handler:timeStamp', 12);
|
| + assert.equal(tce.size, 10);
|
| + assert.equal(tce.name, 'Handler:timeStamp');
|
| + assert.equal(tce.sourceInfo.isNative, false);
|
| + assert.equal(tce.sourceInfo.file, undefined);
|
| + assert.equal(tce.sourceInfo.line, -1);
|
| + assert.equal(tce.sourceInfo.scriptId, 12);
|
| + });
|
| +
|
| + test('non_lazy_compile_method', function() {
|
| + var tce = new tr.e.importer.TraceCodeEntry(10, 'Handler:timeStamp', 12);
|
| + assert.equal(tce.size, 10);
|
| + assert.equal(tce.name, 'Handler:timeStamp');
|
| + assert.equal(tce.sourceInfo.isNative, false);
|
| + assert.equal(tce.sourceInfo.file, undefined);
|
| + assert.equal(tce.sourceInfo.line, -1);
|
| + assert.equal(tce.sourceInfo.scriptId, 12);
|
| + });
|
| +
|
| + test('native_matching', function() {
|
| + var tce = new tr.e.importer.TraceCodeEntry(10,
|
| + 'LazyCompile:~IsAccessorDescriptor native v8natives.js:183', 12);
|
| + assert.equal(tce.size, 10);
|
| + assert.equal(tce.name, 'IsAccessorDescriptor');
|
| + assert.equal(tce.sourceInfo.isNative, true);
|
| + assert.equal(tce.sourceInfo.file, 'v8natives.js');
|
| + assert.equal(tce.sourceInfo.line, 183);
|
| + assert.equal(tce.sourceInfo.scriptId, 12);
|
| + });
|
| +
|
| + test('non_native_matching', function() {
|
| + var tce = new tr.e.importer.TraceCodeEntry(10,
|
| + 'LazyCompile:~IsAccessorDescriptor v8natives.js:183', 12);
|
| + assert.equal(tce.size, 10);
|
| + assert.equal(tce.name, 'IsAccessorDescriptor');
|
| + assert.equal(tce.sourceInfo.isNative, false);
|
| + assert.equal(tce.sourceInfo.file, 'v8natives.js');
|
| + assert.equal(tce.sourceInfo.line, 183);
|
| + assert.equal(tce.sourceInfo.scriptId, 12);
|
| + });
|
| +
|
| + test('lazy_compile_without_script', function() {
|
| + var tce = new tr.e.importer.TraceCodeEntry(10, 'LazyCompile:~Object', 12);
|
| + assert.equal(tce.size, 10);
|
| + assert.equal(tce.name, 'Object');
|
| + assert.equal(tce.sourceInfo.isNative, false);
|
| + assert.equal(tce.sourceInfo.file, undefined);
|
| + assert.equal(tce.sourceInfo.line, -1);
|
| + assert.equal(tce.sourceInfo.scriptId, 12);
|
| + });
|
| +
|
| + test('line_matching_without_script', function() {
|
| + var tce = new tr.e.importer.TraceCodeEntry(10,
|
| + 'LazyCompile:~Object :220', 12);
|
| + assert.equal(tce.size, 10);
|
| + assert.equal(tce.name, 'Object');
|
| + assert.equal(tce.sourceInfo.isNative, false);
|
| + assert.equal(tce.sourceInfo.file, '');
|
| + assert.equal(tce.sourceInfo.line, 220);
|
| + assert.equal(tce.sourceInfo.scriptId, 12);
|
| + });
|
| +
|
| + test('unknown_method_name', function() {
|
| + var tce = new tr.e.importer.TraceCodeEntry(10, 'LazyCompile:', 12);
|
| + assert.equal(tce.size, 10);
|
| + assert.equal(tce.name, 'unknown');
|
| + assert.equal(tce.sourceInfo.isNative, false);
|
| + assert.equal(tce.sourceInfo.file, undefined);
|
| + assert.equal(tce.sourceInfo.line, -1);
|
| + assert.equal(tce.sourceInfo.scriptId, 12);
|
| +
|
| + var tce = new tr.e.importer.TraceCodeEntry(10, 'LazyCompile:~ :37', 12);
|
| + assert.equal(tce.size, 10);
|
| + assert.equal(tce.name, 'unknown');
|
| + assert.equal(tce.sourceInfo.isNative, false);
|
| + assert.equal(tce.sourceInfo.file, '');
|
| + assert.equal(tce.sourceInfo.line, 37);
|
| + assert.equal(tce.sourceInfo.scriptId, 12);
|
| +
|
| + var tce = new tr.e.importer.TraceCodeEntry(10,
|
| + 'LazyCompile:~ native liveedit.js:37', 12);
|
| + assert.equal(tce.size, 10);
|
| + assert.equal(tce.name, 'unknown');
|
| + assert.equal(tce.sourceInfo.isNative, true);
|
| + assert.equal(tce.sourceInfo.file, 'liveedit.js');
|
| + assert.equal(tce.sourceInfo.line, 37);
|
| + assert.equal(tce.sourceInfo.scriptId, 12);
|
| + });
|
| +});
|
| +</script>
|
| +
|
|
|