Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / third_party / tvcm / src / tvcm / utils_test.js
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 'use strict';
6
7 tvcm.require('tvcm.utils');
8
9 tvcm.unittest.testSuite('tvcm.utils_test', function() {
10   test('clamping', function() {
11     assertEquals(2, tvcm.clamp(2, 1, 3));
12     assertEquals(1, tvcm.clamp(1, 1, 3));
13     assertEquals(1, tvcm.clamp(0, 1, 3));
14     assertEquals(3, tvcm.clamp(3, 1, 3));
15     assertEquals(3, tvcm.clamp(4, 1, 3));
16   });
17 });