Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-thread-creation.html |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-thread-creation.html b/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-thread-creation.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d2df6fe1d8aad986e1c7167d7def27415a78e66e |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-thread-creation.html |
| @@ -0,0 +1,50 @@ |
| +<!DOCTYPE html> |
| +<html> |
| + <head> |
| + <title> |
| + OfflineAudioContext - Thread Creation |
| + </title> |
| + <script src="../../resources/testharness.js"></script> |
| + <script src="../../resources/testharnessreport.js"></script> |
| + <script src="../resources/audit.js"></script> |
| + </head> |
| + <body> |
| + <script id="layout-test-code"> |
| + const audit = Audit.createTaskRunner(); |
| + |
| + // The common sample rate. |
| + const sampleRate = 48000; |
| + |
| + // To make channel count and buffer length irrelevant to this test. |
| + const numberOfChannels = 1; |
| + const renderLength = 1; |
| + |
| + // Create 2500 contexts in total. |
| + const maxNumberOfContexts = 5000; |
| + |
| + // Create multiple contexts and drop them rapidly. This should not crash |
| + // the browser with out-of-threads error. The test code here is based on |
| + // crbug.com/716800. |
| + audit.define( |
| + { |
| + label: 'thread-creation', |
| + description: |
| + 'Creating ' + maxNumberOfContexts + ' contexts without a crash.' |
| + }, |
| + (task, should) => { |
| + let i; |
| + for (i = 0; i < maxNumberOfContexts; ++i) { |
| + let context = new OfflineAudioContext( |
| + numberOfChannels, renderLength, sampleRate); |
| + delete context; |
| + } |
| + |
| + should(i, 'The number of created contexts without a crash') |
|
Raymond Toy
2017/05/23 18:38:27
This is kind of odd because if it crashes, we'll n
hongchan
2017/05/23 20:30:19
Like you pointed out, the out-of-thread immediatel
|
| + .beEqualTo(maxNumberOfContexts); |
| + task.done(); |
| + }); |
| + |
| + audit.run(); |
| + </script> |
| + </body> |
| +</html> |