| OLD | NEW |
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 should([1, 0, 1]).notBeConstantValueOf(1); | 58 should([1, 0, 1]).notBeConstantValueOf(1); |
| 59 should([1, 0, 0, 1]).notBeConstantValueOf(1); | 59 should([1, 0, 0, 1]).notBeConstantValueOf(1); |
| 60 should([1, 1, 1]).beEqualToArray([1, 1, 1]); | 60 should([1, 1, 1]).beEqualToArray([1, 1, 1]); |
| 61 should([1, 1, 1, 1, 2, 2, 3, 3, 3]) | 61 should([1, 1, 1, 1, 2, 2, 3, 3, 3]) |
| 62 .containValues([1, 2, 3], 'one, two, three'); | 62 .containValues([1, 2, 3], 'one, two, three'); |
| 63 should([0.5, 0.5, 0.55, 0.5, 0.45, 0.5]).notGlitch(0.06); | 63 should([0.5, 0.5, 0.55, 0.5, 0.45, 0.5]).notGlitch(0.06); |
| 64 task.done(); | 64 task.done(); |
| 65 } | 65 } |
| 66 ); | 66 ); |
| 67 | 67 |
| 68 audit.define({ |
| 69 label: 'numerical typed arrays', |
| 70 description: 'Numerical assertion unit test with typed arrays.' |
| 71 }, function (task, should) { |
| 72 let testValues = [1,2,3]; |
| 73 should(Uint8Array.from(testValues), 'Uint8Array').beEqualToArray(testValue
s); |
| 74 should(Float32Array.from(testValues), 'Float32Array').beEqualToArray(testV
alues); |
| 75 should(Float64Array.from(testValues), 'Float64Array').beEqualToArray(testV
alues); |
| 76 task.done(); |
| 77 }); |
| 78 |
| 68 // Test Audit.loadFileFromUrl() within |should| assertion. | 79 // Test Audit.loadFileFromUrl() within |should| assertion. |
| 69 // See: crbug.com/701813 | 80 // See: crbug.com/701813 |
| 70 audit.define({ | 81 audit.define({ |
| 71 label: 'load-file-in-should', | 82 label: 'load-file-in-should', |
| 72 description: 'Test Audit.loadFileFromUrl() within |should| assertion.' | 83 description: 'Test Audit.loadFileFromUrl() within |should| assertion.' |
| 73 }, (task, should) => { | 84 }, (task, should) => { |
| 74 let url = '../resources/hyper-reality/laughter.wav'; | 85 let url = '../resources/hyper-reality/laughter.wav'; |
| 75 let promise = should(Audit.loadFileFromUrl(url), | 86 let promise = should(Audit.loadFileFromUrl(url), |
| 76 'Loading file within should().beResolved()') | 87 'Loading file within should().beResolved()') |
| 77 .beResolved(); | 88 .beResolved(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 96 // This task is defined, but you can selectively opt it out when the task | 107 // This task is defined, but you can selectively opt it out when the task |
| 97 // runs. If you would like to see how failure cases get printed, include | 108 // runs. If you would like to see how failure cases get printed, include |
| 98 // this task and launch the task runner. | 109 // this task and launch the task runner. |
| 99 audit.define('empty', function (task, should) { | 110 audit.define('empty', function (task, should) { |
| 100 task.done(); | 111 task.done(); |
| 101 }); | 112 }); |
| 102 | 113 |
| 103 | 114 |
| 104 // You can enumerate tasks you want to execute in the order, or simply pass | 115 // You can enumerate tasks you want to execute in the order, or simply pass |
| 105 // no argument to run all the defined tasks. | 116 // no argument to run all the defined tasks. |
| 106 audit.run('numerical', 'basic', 'load-file-in-should', | 117 audit.run('numerical', 'numerical typed arrays', 'basic', |
| 107 'dummy-label-string', 'dummy-label-object'); | 118 'load-file-in-should', 'dummy-label-string', 'dummy-label-object')
; |
| 108 </script> | 119 </script> |
| 109 </body> | 120 </body> |
| 110 </html> | 121 </html> |
| OLD | NEW |