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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-thread-creation.html

Issue 2889393003: Lazy initialization of the rendering thread in OfflineAudioContext (Closed)
Patch Set: Address feedback Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698