blob: f2b845731776095129ef9701a089ca644568afed [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright (c) 2013 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="/ui/timeline_viewport.html">
<script>
'use strict';
tr.b.unittest.testSuite(function() {
test('memoization', function() {
var vp = new tr.ui.TimelineViewport(document.createElement('div'));
var slice = { guid: 1 };
vp.modelTrackContainer = {
addEventsToTrackMap: function(eventToTrackMap) {
eventToTrackMap.addEvent(slice, 'track');
},
addEventListener: function() {}
};
assert.isUndefined(vp.trackForEvent(slice));
vp.rebuildEventToTrackMap();
assert.equal(vp.trackForEvent(slice), 'track');
});
});
</script>