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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontext-max-contexts.html

Issue 2727663003: Move task.describe to audit.define arg (Closed)
Patch Set: Fix up expected results 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 <script src="../../resources/testharness.js"></script> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="../resources/audit-util.js"></script> 6 <script src="../resources/audit-util.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>
11 let audit = Audit.createTaskRunner(); 11 let audit = Audit.createTaskRunner();
12 12
13 let contextsToCreate = 10; 13 let contextsToCreate = 10;
14 14
15 function reachHardwareContextsLimit() { 15 function reachHardwareContextsLimit() {
16 let context = []; 16 let context = [];
17 for (let i = 0; i < contextsToCreate; ++i) 17 for (let i = 0; i < contextsToCreate; ++i)
18 context[i] = new AudioContext(); 18 context[i] = new AudioContext();
19 } 19 }
20 20
21 21
22 audit.define("test-limit", function (task, should) { 22 audit.define(
23 task.describe( 23 {
24 "Check that the AudioContext constructor throws when the limit on hardware c ontexts is reached." 24 label: 'hardware-context-limit',
25 ); 25 description: 'AudioContext throws when hardware context limit is reached'
26 should(function () { 26 },
27 reachHardwareContextsLimit(); 27 function(task, should) {
28 }, "Create " + contextsToCreate + " concurrent AudioContext's") 28 should(
29 .throw("NotSupportedError"); 29 function() {
30 reachHardwareContextsLimit();
31 },
32 'Create ' + contextsToCreate + ' concurrent AudioContext\'s')
33 .throw('NotSupportedError');
30 34
31 task.done(); 35 task.done();
32 }); 36 });
33 37
34 audit.run(); 38 audit.run();
35 </script> 39 </script>
36 </body> 40 </body>
37 </html> 41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698