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

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

Issue 2889393003: Lazy initialization of the rendering thread in OfflineAudioContext (Closed)
Patch Set: Adjusting number of contexts for timed-out trybots 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-smoke-test.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-thread-smoke-test.html b/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-thread-smoke-test.html
new file mode 100644
index 0000000000000000000000000000000000000000..88342271a2299a1e5341318ac4e67f19def4025f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/webaudio/OfflineAudioContext/offlineaudiocontext-thread-smoke-test.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>
+ OfflineAudioContext - Thread Smoke Test
+ </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. 58.0.3029 on OSX crashes around 2030.
+ const maxNumberOfContexts = 2500;
+
+ let contexts = [];
+
+ // For recursive and sequential rendering of multiple context.
+ function recurseContextRendering(index, oncomplete) {
+ if (index < maxNumberOfContexts) {
+ contexts[index].startRendering().then(() => {
+ recurseContextRendering(index + 1, oncomplete);
+ });
+ } else {
+ oncomplete(index);
+ }
+ }
+
+ // Create contexts up front, but do not start rendering. Based on
+ // crbug.com/716800, this caused a crash with out-of-threads error.
+ audit.define(
+ {
+ label: 'context-creation-smoketest',
+ description:
+ 'Creating ' + maxNumberOfContexts + ' contexts up front.'
+ },
+ (task, should) => {
+ let i;
+ for (i = 0; i < maxNumberOfContexts; ++i) {
+ contexts.push(new OfflineAudioContext(
+ numberOfChannels, renderLength, sampleRate));
+ }
+ should(i, 'The number of created contexts without a crash')
+ .beEqualTo(maxNumberOfContexts);
+ task.done();
+ });
+
+ // Create contexts, render and drop them sequentially. This should not
+ // crash the browser with out-of-threads error.
+ audit.define(
+ {
+ label: 'rendering-thread-smoketest',
+ description:
+ 'Rendering ' + maxNumberOfContexts + ' contexts sequentially.'
+ },
+ (task, should) => {
+ recurseContextRendering(0, (counter) => {
+ should(counter, 'The number of contexts rendered without a crash')
+ .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