3 Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
8 <link rel="import" href="/tracing/importer/trace2html_importer.html">
13 tv.unittest.testSuite(function() { // @suppress longLineCheck
14 test('simple', function() {
17 '<script id="viewer-data" type="application/json">',
20 '<script id="viewer-data" type="application/json">',
25 var html_text = html_lines.join('\n');
26 assertTrue(tracing.importer.Trace2HTMLImporter.canImport(html_text));
28 var m = new tracing.TraceModel();
29 var imp = new tracing.importer.Trace2HTMLImporter(m, html_text);
30 var subTracesAsBuffers = imp.extractSubtraces();
31 var subTracesAsStrings = subTracesAsBuffers.map(function(buffer) {
33 var ary = new Uint8Array(buffer);
34 for (var i = 0; i < ary.length; i++)
35 str += String.fromCharCode(ary[i]);
38 assertArrayEquals(['hello', 'world'], subTracesAsStrings);