<!DOCTYPE HTML>
<html>
<!--
Copyright (c) 2011 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.
-->
<head i18n-values="dir:textdirection;">
<title>Interactive Timeline Tests</title>
<link rel="stylesheet" href="timeline.css">
<script src="../shared/js/cr.js"></script>
<script src="../shared/js/cr/event_target.js"></script>
<script src="../shared/js/cr/ui.js"></script>
<script src="../shared/js/util.js"></script>
<script src="timeline_model.js"></script>
<script src="linux_perf_importer.js"></script>
<script src="trace_event_importer.js"></script>
<script src="sorted_array_utils.js"></script>
<script src="measuring_stick.js"></script>
<script src="timeline.js"></script>
<script src="timeline_track.js"></script>
<script src="fast_rect_renderer.js"></script>
<script src="test_utils.js"></script>
</head>
<body>
  <div class="timeline-test" src="./tests/trivial_trace.json" create-detached=1>
  </div>

  <div class="timeline-test" src="./tests/trivial_trace.json">
  </div>

  <div class="timeline-test" src="./tests/simple_trace.json">
  </div>

  <div class="timeline-test" src="./tests/instance_counters.json">
  </div>

  <div class="timeline-test" src="./tests/nonnested_trace.json">
  </div>

  <div class="timeline-test" src="./tests/tall_trace.json">
  </div>

  <div class="timeline-test" src="./tests/big_trace.json">
  </div>

  <div class="timeline-test" src="./tests/huge_trace.json">
  </div>

  <div class="timeline-test" src="./tests/main_thread_has_unclosed_slices.json">
  </div>

  <div class="timeline-test" src="./tests/linux_perf_simple.txt">
  </div>

  <script>
  function load(parentEl) {
    var src = parentEl.getAttribute('src');
    if (document.location.hash && document.location.hash.substring(1) != src) {
      parentEl.hidden = true;
      return;
    }
    parentEl.hidden = false;
    parentEl.textContent = '';
    var titleEl = document.createElement('h3');
    var linkEl = document.createElement('a');
    linkEl.textContent = src;
    linkEl.href = '#' + src;
    titleEl.appendChild(linkEl);

    var containerEl = document.createElement('div');
    containerEl.tabIndex = 0;
    containerEl.style.border = '1px solid red';

    var timelineEl = document.createElement('div');
    cr.ui.decorate(timelineEl, tracing.Timeline);
    timelineEl.focusElement = containerEl;

    parentEl.appendChild(titleEl);
    parentEl.appendChild(containerEl);

    // Creating attached vs detached stress tests the canvas- and viewport-
    // setup code.
    var create_detached = parentEl.getAttribute('create-attached') == 1;
    function createModel(data) {
      timelineEl.model = new tracing.TimelineModel(data);
      if (!create_detached)
        containerEl.appendChild(timelineEl);
    }
    if (create_detached)
      containerEl.appendChild(timelineEl);
    test_utils.getAsync(src, createModel);
  }

  function onLoad() {
    Array.prototype.forEach.call(document.querySelectorAll('.timeline-test'),
                                 load);
  }

  document.addEventListener('DOMContentLoaded', onLoad);
  window.addEventListener('hashchange', onLoad);
  </script>
</body>
</html>
