blob: bc7873603fb106e1acab429ff6e5c03b051b0797 [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="/core/timeline_viewport.html">
<script>
'use strict';
tr.b.unittest.testSuite(function() {
test('memoization', function() {
var vp = new tr.c.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>