Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: tools/cc-frame-viewer/src/base/color_test.html

Issue 15736032: Remove old cc-frame-viewer now that it is upstreamed into trace_viewer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/cc-frame-viewer/src/base/color.js ('k') | tools/cc-frame-viewer/src/base/deps.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 Copyright (c) 2012 The Chromium Authors. All rights reserved.
5 Use of this source code is governed by a BSD-style license that can be
6 found in the LICENSE file.
7 -->
8 <head>
9 <script src="../base.js"></script>
10 <script>
11 base.require('base.unittest');
12 base.require('base.color');
13 </script>
14 </head>
15 <body>
16 <script>
17 'use strict';
18
19 var Color = base.Color;
20
21 function testFromRGB() {
22 var c = Color.fromString('rgb(1, 2, 3)');
23 assertEquals(1, c.r);
24 assertEquals(2, c.g);
25 assertEquals(3, c.b);
26 assertEquals(undefined, c.a);
27 }
28 function testFromString() {
29 var c = Color.fromString('rgba(1, 2, 3, 0.5)');
30 assertEquals(1, c.r);
31 assertEquals(2, c.g);
32 assertEquals(3, c.b);
33 assertEquals(0.5, c.a);
34 }
35 function testFromString() {
36 var c = Color.fromString('#010203');
37 assertEquals(1, c.r);
38 assertEquals(2, c.g);
39 assertEquals(3, c.b);
40 assertEquals(undefined, c.a);
41 }
42
43 function testToStringRGB() {
44 var c = new Color(1, 2, 3);
45 assertEquals('rgb(1,2,3)', c.toString());
46 }
47
48 function testToStringRGBA() {
49 var c = new Color(1, 2, 3, 0.5);
50 assertEquals('rgba(1,2,3,0.5)', c.toString());
51 }
52
53 function testLerpRGB() {
54 var a = new Color(0, 127, 191);
55 var b = new Color(255, 255, 255);
56 var x = Color.lerpRGB(a, b, 0.25);
57 assertEquals(63, x.r);
58 assertEquals(159, x.g);
59 assertEquals(207, x.b);
60 }
61
62 function testLerpRGBA() {
63 var a = new Color(0, 127, 191, 0.5);
64 var b = new Color(255, 255, 255, 1);
65 var x = Color.lerpRGBA(a, b, 0.25);
66 assertEquals(63, x.r);
67 assertEquals(159, x.g);
68 assertEquals(207, x.b);
69 assertEquals(0.625, x.a);
70 }
71 </script>
72 </body>
73 </html>
OLDNEW
« no previous file with comments | « tools/cc-frame-viewer/src/base/color.js ('k') | tools/cc-frame-viewer/src/base/deps.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698