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

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

Issue 2766883002: Allow status = 0 when XHR is completed in Audit.loadFileFromUrl(). (Closed)
Patch Set: Fix Audit.loadAudioFileFromUrl() Created 3 years, 9 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // Test Audit.loadFileFromUrl() within |should| assertion.
69 // See: crbug.com/701813
70 audit.define({
71 label: 'load-file-in-should',
72 description: 'Test Audit.loadFileFromUrl() within |should| assertion.'
73 }, (task, should) => {
74 let url = '../resources/hyper-reality/laughter.wav';
75 let promise = should(Audit.loadFileFromUrl(url),
76 'Loading file within should().beResolved()')
77 .beResolved();
78 promise.then(() => { task.done() });
79 }
80 );
81
68 82
69 // The task headline needs to be printed even if there is no description is 83 // The task headline needs to be printed even if there is no description is
70 // given. 84 // given.
71 audit.define('dummy-label-string', function (task) { 85 audit.define('dummy-label-string', function (task) {
72 task.done(); 86 task.done();
73 }); 87 });
74 88
75 89
76 // Test the same thing in a differen way. 90 // Test the same thing in a differen way.
77 audit.define({ label: 'dummy-label-object' }, function (task) { 91 audit.define({ label: 'dummy-label-object' }, function (task) {
78 task.done(); 92 task.done();
79 }); 93 });
80 94
81 95
82 // This task is defined, but you can selectively opt it out when the task 96 // This task is defined, but you can selectively opt it out when the task
83 // runs. If you would like to see how failure cases get printed, include 97 // runs. If you would like to see how failure cases get printed, include
84 // this task and launch the task runner. 98 // this task and launch the task runner.
85 audit.define('empty', function (task, should) { 99 audit.define('empty', function (task, should) {
86 task.done(); 100 task.done();
87 }); 101 });
88 102
89 103
90 // You can enumerate tasks you want to execute in the order, or simply pass 104 // You can enumerate tasks you want to execute in the order, or simply pass
91 // no argument to run all the defined tasks. 105 // no argument to run all the defined tasks.
92 audit.run('numerical', 'basic', 'dummy-label-string', 'dummy-label-object'); 106 audit.run('numerical', 'basic', 'load-file-in-should',
Raymond Toy 2017/03/21 21:16:33 What's the reason for maintaining this list? Is it
hongchan 2017/03/21 23:07:57 This is the example that the list can be arranged
Raymond Toy 2017/03/21 23:13:36 Acknowledged.
107 'dummy-label-string', 'dummy-label-object');
93 </script> 108 </script>
94 </body> 109 </body>
95 </html> 110 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698