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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html

Issue 2618053002: Implement should().notBeConstantValueOf(x) (Closed)
Patch Set: Addressing nit after l-g-t-m Created 3 years, 11 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>audit.js: basic tests</title> 4 <title>audit.js: basic tests</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../resources/audit.js"></script> 7 <script src="../resources/audit.js"></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <script> 10 <script>
(...skipping 28 matching lines...) Expand all
39 39
40 40
41 // Advanced, mostly array-based numerical testing. Note that some codes 41 // Advanced, mostly array-based numerical testing. Note that some codes
42 // are commented out to avoid the trybot failure. These failures are 42 // are commented out to avoid the trybot failure. These failures are
43 // intentional, to demonstrate how the detailed failure report works. 43 // intentional, to demonstrate how the detailed failure report works.
44 audit.define('numerical', function (task, should) { 44 audit.define('numerical', function (task, should) {
45 task.describe('Numerical assertion unit test.'); 45 task.describe('Numerical assertion unit test.');
46 46
47 should(2.3).beCloseTo(2, { threshold: 0.3 }); 47 should(2.3).beCloseTo(2, { threshold: 0.3 });
48 should([1, 1, 1]).beConstantValueOf(1); 48 should([1, 1, 1]).beConstantValueOf(1);
49 should([1, 0, 1]).notBeConstantValueOf(1);
50 should([1, 0, 0, 1]).notBeConstantValueOf(1);
49 should([1, 1, 1]).beEqualToArray([1, 1, 1]); 51 should([1, 1, 1]).beEqualToArray([1, 1, 1]);
50 should([1, 1, 1, 1, 2, 2, 3, 3, 3]) 52 should([1, 1, 1, 1, 2, 2, 3, 3, 3])
51 .containValues([1, 2, 3], 'one, two, three'); 53 .containValues([1, 2, 3], 'one, two, three');
52 should([0.5, 0.5, 0.55, 0.5, 0.45, 0.5]).notGlitch(0.06); 54 should([0.5, 0.5, 0.55, 0.5, 0.45, 0.5]).notGlitch(0.06);
53 55
54 task.done(); 56 task.done();
55 }); 57 });
56 58
57 59
58 // This task is defined, but you can selectively opt it out when the task 60 // This task is defined, but you can selectively opt it out when the task
59 // runs. If you would like to see how failure cases get printed, include 61 // runs. If you would like to see how failure cases get printed, include
60 // this task and launch the task runner. 62 // this task and launch the task runner.
61 audit.define('empty', function (task, should) { 63 audit.define('empty', function (task, should) {
62 task.describe('This is an empty task.'); 64 task.describe('This is an empty task.');
63 65
64 task.done(); 66 task.done();
65 }); 67 });
66 68
67 69
68 // You can enumerate tasks you want to execute in the order, or simply pass 70 // You can enumerate tasks you want to execute in the order, or simply pass
69 // no argument to run all the defined tasks. 71 // no argument to run all the defined tasks.
70 audit.run('numerical', 'basic'); 72 audit.run('numerical', 'basic');
71 </script> 73 </script>
72 </body> 74 </body>
73 </html> 75 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698