OLD | NEW |
(Empty) | |
| 1 dart_library.library('lib/html/audiocontext_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'unittest' |
| 4 ], function load__audiocontext_test(exports, dart_sdk, unittest) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const web_audio = dart_sdk.web_audio; |
| 8 const dart = dart_sdk.dart; |
| 9 const dartx = dart_sdk.dartx; |
| 10 const html_individual_config = unittest.html_individual_config; |
| 11 const src__matcher__core_matchers = unittest.src__matcher__core_matchers; |
| 12 const unittest$ = unittest.unittest; |
| 13 const src__matcher__expect = unittest.src__matcher__expect; |
| 14 const audiocontext_test = Object.create(null); |
| 15 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
| 16 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 17 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 18 audiocontext_test.main = function() { |
| 19 html_individual_config.useHtmlIndividualConfiguration(); |
| 20 let isAudioContext = src__matcher__core_matchers.predicate(dart.fn(x => web_
audio.AudioContext.is(x), dynamicTobool()), 'is an AudioContext'); |
| 21 unittest$.group('supported', dart.fn(() => { |
| 22 unittest$.test('supported', dart.fn(() => { |
| 23 src__matcher__expect.expect(web_audio.AudioContext[dartx.supported], tru
e); |
| 24 }, VoidTodynamic())); |
| 25 }, VoidTovoid())); |
| 26 unittest$.group('functional', dart.fn(() => { |
| 27 let context = null; |
| 28 if (dart.test(web_audio.AudioContext[dartx.supported])) { |
| 29 context = web_audio.AudioContext.new(); |
| 30 } |
| 31 unittest$.test('constructorTest', dart.fn(() => { |
| 32 if (dart.test(web_audio.AudioContext[dartx.supported])) { |
| 33 src__matcher__expect.expect(context, src__matcher__core_matchers.isNot
Null); |
| 34 src__matcher__expect.expect(context, isAudioContext); |
| 35 } |
| 36 }, VoidTodynamic())); |
| 37 unittest$.test('audioRenames', dart.fn(() => { |
| 38 if (dart.test(web_audio.AudioContext[dartx.supported])) { |
| 39 let gainNode = web_audio.GainNode._check(dart.dsend(context, 'createGa
in')); |
| 40 gainNode[dartx.connectNode](web_audio.AudioNode._check(dart.dload(cont
ext, 'destination'))); |
| 41 src__matcher__expect.expect(web_audio.GainNode.is(gainNode), src__matc
her__core_matchers.isTrue); |
| 42 src__matcher__expect.expect(web_audio.AnalyserNode.is(dart.dsend(conte
xt, 'createAnalyser')), src__matcher__core_matchers.isTrue); |
| 43 src__matcher__expect.expect(web_audio.AudioNode.is(dart.dsend(context,
'createChannelMerger')), src__matcher__core_matchers.isTrue); |
| 44 src__matcher__expect.expect(web_audio.AudioNode.is(dart.dsend(context,
'createChannelSplitter')), src__matcher__core_matchers.isTrue); |
| 45 src__matcher__expect.expect(web_audio.OscillatorNode.is(dart.dsend(con
text, 'createOscillator')), src__matcher__core_matchers.isTrue); |
| 46 src__matcher__expect.expect(web_audio.PannerNode.is(dart.dsend(context
, 'createPanner')), src__matcher__core_matchers.isTrue); |
| 47 src__matcher__expect.expect(web_audio.ScriptProcessorNode.is(dart.dsen
d(context, 'createScriptProcessor', 4096)), src__matcher__core_matchers.isTrue); |
| 48 } |
| 49 }, VoidTodynamic())); |
| 50 unittest$.test('oscillatorTypes', dart.fn(() => { |
| 51 if (dart.test(web_audio.AudioContext[dartx.supported])) { |
| 52 let oscillator = web_audio.OscillatorNode._check(dart.dsend(context, '
createOscillator')); |
| 53 oscillator[dartx.connectNode](web_audio.AudioNode._check(dart.dload(co
ntext, 'destination'))); |
| 54 oscillator[dartx.type] = 'sawtooth'; |
| 55 src__matcher__expect.expect(oscillator[dartx.type], src__matcher__core
_matchers.equals('sawtooth')); |
| 56 oscillator[dartx.type] = 'sine'; |
| 57 src__matcher__expect.expect(oscillator[dartx.type], src__matcher__core
_matchers.equals('sine')); |
| 58 oscillator[dartx.type] = 'square'; |
| 59 src__matcher__expect.expect(oscillator[dartx.type], src__matcher__core
_matchers.equals('square')); |
| 60 oscillator[dartx.type] = 'triangle'; |
| 61 src__matcher__expect.expect(oscillator[dartx.type], src__matcher__core
_matchers.equals('triangle')); |
| 62 src__matcher__expect.expect(oscillator[dartx.type], src__matcher__core
_matchers.equals('triangle')); |
| 63 src__matcher__expect.expect(oscillator[dartx.type], src__matcher__core
_matchers.equals('triangle')); |
| 64 } |
| 65 }, VoidTodynamic())); |
| 66 }, VoidTovoid())); |
| 67 }; |
| 68 dart.fn(audiocontext_test.main, VoidTodynamic()); |
| 69 // Exports: |
| 70 exports.audiocontext_test = audiocontext_test; |
| 71 }); |
OLD | NEW |