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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/resources/audio-testing.js

Issue 1481793002: Drop [LegacyInterfaceTypeChecking] where trivial in Web Audio (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self.hasOwnProperty(errorType) Created 5 years 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 unified diff | Download patch
OLDNEW
1 if (window.testRunner) 1 if (window.testRunner)
2 testRunner.overridePreference("WebKitWebAudioEnabled", "1"); 2 testRunner.overridePreference("WebKitWebAudioEnabled", "1");
3 3
4 function writeString(s, a, offset) { 4 function writeString(s, a, offset) {
5 for (var i = 0; i < s.length; ++i) { 5 for (var i = 0; i < s.length; ++i) {
6 a[offset + i] = s.charCodeAt(i); 6 a[offset + i] = s.charCodeAt(i);
7 } 7 }
8 } 8 }
9 9
10 function writeInt16(n, a, offset) { 10 function writeInt16(n, a, offset) {
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 } 590 }
591 591
592 try { 592 try {
593 this.target(); 593 this.target();
594 this._testFailed('did not throw an exception'); 594 this._testFailed('did not throw an exception');
595 } catch (error) { 595 } catch (error) {
596 if (errorType === undefined) 596 if (errorType === undefined)
597 this._testPassed('threw an exception of type ' + error.name); 597 this._testPassed('threw an exception of type ' + error.name);
598 else if (error.name === errorType) 598 else if (error.name === errorType)
599 this._testPassed('threw ' + errorType + ': ' + error.message); 599 this._testPassed('threw ' + errorType + ': ' + error.message);
600 else if (self.hasOwnProperty(errorType) && error instanceof self[err orType])
601 this._testPassed('threw ' + errorType + ': ' + error.message);
600 else 602 else
601 this._testFailed('threw ' + error.name + ' instead of ' + except ion); 603 this._testFailed('threw ' + error.name + ' instead of ' + except ion);
602 } 604 }
603 return this._success; 605 return this._success;
604 }; 606 };
605 607
606 // Check if |func| does not throw an exception. 608 // Check if |func| does not throw an exception.
607 // 609 //
608 // Example: 610 // Example:
609 // Should('var foo = "bar"', function () { var foo = 'bar'; }).notThrow(); 611 // Should('var foo = "bar"', function () { var foo = 'bar'; }).notThrow();
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 if (opts.hasOwnProperty('numberOfErrorLog')) 833 if (opts.hasOwnProperty('numberOfErrorLog'))
832 _opts.numberOfErrorLog = opts.numberOfErrorLog; 834 _opts.numberOfErrorLog = opts.numberOfErrorLog;
833 if (opts.hasOwnProperty('numberOfArrayLog')) 835 if (opts.hasOwnProperty('numberOfArrayLog'))
834 _opts.numberOfArrayLog = opts.numberOfArrayLog; 836 _opts.numberOfArrayLog = opts.numberOfArrayLog;
835 } 837 }
836 838
837 return new ShouldModel(desc, target, _opts); 839 return new ShouldModel(desc, target, _opts);
838 }; 840 };
839 841
840 })(); 842 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698