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

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

Issue 2616623006: Convert audiocontext-close-basic and max-contexts to testharness (Closed)
Patch Set: Clean up Created 3 years, 11 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
Index: third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontext-max-contexts.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontext-max-contexts.html b/third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontext-max-contexts.html
index 12af774bdcf49c5e672b14dd6d55c02bc269c22e..af8611f75cee27b9329c6bf56e973695a2d6d990 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontext-max-contexts.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioContext/audiocontext-max-contexts.html
@@ -1,19 +1,37 @@
<!DOCTYPE html>
<html>
<head>
-<script src="../../resources/js-test.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../resources/audit-util.js"></script>
+<script src="../resources/audit.js"></script>
</head>
<body>
<script>
-description("Check that the AudioContext constructor throws when the limit on hardware contexts is reached.");
+let audit = Audit.createTaskRunner();
+
+let contextsToCreate = 10;
function reachHardwareContextsLimit() {
- var context = [];
- for (var i=0; i<10; ++i)
- context[i] = new AudioContext();
+ let context = [];
+ for (let i = 0; i < contextsToCreate; ++i)
+ context[i] = new AudioContext();
}
-shouldThrow("reachHardwareContextsLimit()");
+
+audit.define("test-limit", function (task, should) {
+ task.describe(
+ "Check that the AudioContext constructor throws when the limit on hardware contexts is reached."
+ );
+ should(function () {
+ reachHardwareContextsLimit();
+ }, "Create " + contextsToCreate + " concurrent AudioContext's")
+ .throw("NotSupportedError");
+
+ task.done();
+});
+
+audit.run();
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698