Skip to content

Commit

Permalink
update expectation tests for Chrome v59
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisguttandin committed Jun 9, 2017
1 parent 24255b7 commit cce7371
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/providers/audio-context-constructor.ts
Expand Up @@ -487,7 +487,7 @@ export const AUDIO_CONTEXT_CONSTRUCTOR_PROVIDER = {
public decodeAudioData (
audioData: ArrayBuffer, successCallback?: TDecodeSuccessCallback, errorCallback?: TDecodeErrorCallback
): Promise<AudioBuffer> {
// Bug #43: Only Chrome Canary does yet throw a DataCloneError.
// Bug #43: Only Chrome does yet throw a DataCloneError.
if (detachedAudioBuffers.has(audioData)) {
const err = dataCloneErrorFactory.create();

Expand Down
3 changes: 2 additions & 1 deletion src/providers/offline-audio-context-constructor.ts
Expand Up @@ -184,7 +184,8 @@ export const OFFLINE_AUDIO_CONTEXT_CONSTRUCTOR_PROVIDER = {

public decodeAudioData (
audioData: ArrayBuffer, successCallback?: TDecodeSuccessCallback, errorCallback?: TDecodeErrorCallback
): Promise<AudioBuffer> { // Bug #43: Only Chrome Canary does yet throw a DataCloneError.
): Promise<AudioBuffer> {
// Bug #43: Only Chrome does yet throw a DataCloneError.
if (detachedAudioBuffers.has(audioData)) {
const err = dataCloneErrorFactory.create();

Expand Down
14 changes: 0 additions & 14 deletions test/expectation/chrome/current/audio-context-constructor.js
Expand Up @@ -2,7 +2,6 @@ import 'core-js/es7/reflect';
import { UNPATCHED_AUDIO_CONTEXT_CONSTRUCTOR_PROVIDER, unpatchedAudioContextConstructor } from '../../../../src/providers/unpatched-audio-context-constructor';
import { ReflectiveInjector } from '@angular/core';
import { WINDOW_PROVIDER } from '../../../../src/providers/window';
import { loadFixture } from '../../../helper/load-fixture';
import { spy } from 'sinon';

describe('audioContextConstructor', () => {
Expand Down Expand Up @@ -119,19 +118,6 @@ describe('audioContextConstructor', () => {
}, 1000);
});

// bug #43

it('should not throw a DataCloneError', (done) => {
loadFixture('1000-frames-of-noise.wav', (err, arrayBuffer) => {
expect(err).to.be.null;

audioContext
.decodeAudioData(arrayBuffer)
.then(() => audioContext.decodeAudioData(arrayBuffer))
.then(() => done());
});
});

});

});
Expand Up @@ -2,7 +2,6 @@ import 'core-js/es7/reflect';
import { UNPATCHED_OFFLINE_AUDIO_CONTEXT_CONSTRUCTOR_PROVIDER, unpatchedOfflineAudioContextConstructor } from '../../../../src/providers/unpatched-offline-audio-context-constructor';
import { ReflectiveInjector } from '@angular/core';
import { WINDOW_PROVIDER } from '../../../../src/providers/window';
import { loadFixture } from '../../../helper/load-fixture';
import { spy } from 'sinon';

describe('offlineAudioContextConstructor', () => {
Expand Down Expand Up @@ -122,19 +121,6 @@ describe('offlineAudioContextConstructor', () => {
}, 1000);
});

// bug #43

it('should not throw a DataCloneError', (done) => {
loadFixture('1000-frames-of-noise.wav', (err, arrayBuffer) => {
expect(err).to.be.null;

offlineAudioContext
.decodeAudioData(arrayBuffer)
.then(() => offlineAudioContext.decodeAudioData(arrayBuffer))
.then(() => done());
});
});

});

});

0 comments on commit cce7371

Please sign in to comment.