| <!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'; |
| |
| tv.b.unittest.testSuite(function() { |
| test('memoization', function() { |
| |
| var vp = new tv.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> |
| |