blob: e78752cf0d630a162395b0230b2ebbd61d3f09ac [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright (c) 2015 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/test_utils.html">
<link rel="import" href="/extras/rail/rail_interaction_record.html">
<script>
'use strict';
/**
* @fileoverview Stub version of RAILInteractionRecord for testing.
*/
tr.exportTo('tr.e.rail', function() {
function StubRAILInteractionRecord(args) {
var sd = tr.c.test_utils.getStartAndDurationFromDict(args);
tr.e.rail.RAILInteractionRecord.call(
this, args.railTypeName, args.railTypeName,
sd.start, sd.duration);
this.args = args;
if (args.associatedEvents) {
args.associatedEvents.forEach(function(event) {
this.associatedEvents.push(event);
}, this);
}
}
StubRAILInteractionRecord.prototype = {
__proto__: tr.e.rail.RAILInteractionRecord.prototype,
get normalizedUserPain() {
return this.args.normalizedUserPain;
},
get normalizedEfficiency() {
return this.args.normalizedEfficiency;
}
};
return {
StubRAILInteractionRecord: StubRAILInteractionRecord
};
});
</script>