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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/unit-tests/testharness-test.html

Issue 2212023002: Modifying audio-testing.js to support testharness.js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changing js-test.js loading order Created 4 years, 4 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 | « third_party/WebKit/LayoutTests/webaudio/unit-tests/jstest-test-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/unit-tests/testharness-test.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/unit-tests/testharness-test.html b/third_party/WebKit/LayoutTests/webaudio/unit-tests/testharness-test.html
new file mode 100644
index 0000000000000000000000000000000000000000..c2c80dade07bef04efeb2dd5fb3ebeeea3fb3778
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/webaudio/unit-tests/testharness-test.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>A simple unit testing for audio-testing.js and testharness.js</title>
+
+ <!-- This is the required dependency for testharness + audio-testing. Note
+ that the including order matters because audio-testing.js depends on
+ testharness.js -->
+ <script src="../../resources/testharness.js"></script>
+ <script src="../../resources/testharnessreport.js"></script>
+ <script src="../resources/audio-testing.js"></script>
+
+</head>
+<body>
+ <script>
+ var audit = Audit.createTaskRunner();
+
+ audit.defineTask('foo', function (taskDone) {
+ Should('Zero', 0).beEqualTo(0);
+ Should('One', 1).notBeEqualTo(0);
+ Should('Expected SNR', 110).beGreaterThanOrEqualTo(100);
+ taskDone();
+ });
+
+ audit.defineTask('bar', function (taskDone) {
+ var maxError = 1e-6;
+ Should("Maximum error value", maxError).beLessThanOrEqualTo(1e-5);
+ Should('One point double zero one', 1.001).beCloseTo(1, .1);
+ taskDone();
+ });
+
+ audit.defineTask('boo', function (taskDone) {
+ Should('[2, 2, 2]', [2, 2, 2]).beConstantValueOf(2);
+ Should('[1, 2, 3]', [1, 2, 3]).beEqualToArray([1, 2, 3]);
+ Should('My array', [0.11, 0.19]).beCloseToArray([0.1, 0.2], 0.02);
+ Should('My random array', [1, 1, 3, 3, 2]).containValues([1, 3, 2]);
+ taskDone();
+ });
+
+ audit.runTasks();
+ </script>
+</body>
+</html>
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/unit-tests/jstest-test-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698