blob: 276407e84ae6deadc426eb994c8919062ddbed8d [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="/tracing/extras/rail/response_interaction_record.html">
<script>
'use strict';
tr.b.unittest.testSuite(function() {
var test_utils = tr.c.test_utils;
test('instantiate', function() {
var responseIR = new tr.e.rail.ResponseInteractionRecord(0, 150);
assert.equal(0, responseIR.normalizedUserPain);
responseIR = new tr.e.rail.ResponseInteractionRecord(0, 150.0001);
assert.closeTo(0, responseIR.normalizedUserPain, 1e-5);
responseIR = new tr.e.rail.ResponseInteractionRecord(0, 1000);
assert.equal(1, responseIR.normalizedUserPain);
responseIR = new tr.e.rail.ResponseInteractionRecord(0, 999.999);
assert.closeTo(1, responseIR.normalizedUserPain, 1e-5);
});
});
</script>