Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12fa32d
commit f257b95
Showing
3 changed files
with
102 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* @since 2.2.0 | ||
*/ | ||
|
||
import TestHelpers from '../test-helpers.js'; | ||
|
||
// registers the plugin | ||
import LamejsEngine from '../../src/js/plugins/lamejs-plugin.js'; | ||
import {LAMEJS} from '../../src/js/engine/record-engine.js'; | ||
|
||
|
||
/** @test {LamejsEngine} */ | ||
describe('plugins.lamejs-plugin', function() { | ||
var player; | ||
|
||
afterEach(function() { | ||
player.dispose(); | ||
}); | ||
|
||
/** @test {LamejsEngine} */ | ||
it('should run as an audio-only plugin', function(done) { | ||
// create audio-only player with lamejs plugin | ||
player = TestHelpers.makeAudioOnlyPluginPlayer(LAMEJS); | ||
|
||
player.one('finishRecord', function() { | ||
// received a blob file | ||
expect(player.recordedData instanceof Blob).toBeTruthy(); | ||
|
||
// wait till it's loaded before destroying | ||
// (XXX: create new event for this) | ||
setTimeout(done, 1000); | ||
}); | ||
|
||
player.one('startRecord', function() { | ||
// record some audio | ||
setTimeout(function() { | ||
// stop | ||
player.record().stop(); | ||
}, 2000); | ||
}); | ||
|
||
player.one('deviceReady', function() { | ||
// create snapshot | ||
player.record().start(); | ||
}); | ||
|
||
player.one('ready', function() { | ||
// start device | ||
player.record().getDevice(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters