Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 18485d8

Browse files
committed
test user media
1 parent c595cfa commit 18485d8

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

lib/browser/webapis-user-media.ts

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
return function() {
1111
const args = Array.prototype.slice.call(arguments);
1212
const wrappedArgs = api.bindArguments(args, source ? source : (func as any).name);
13-
console.log('Zone patched user media', Zone.current.name);
1413
return func.apply(this, wrappedArgs);
1514
};
1615
}

test/browser/browser.spec.ts

+15-10
Original file line numberDiff line numberDiff line change
@@ -2505,16 +2505,21 @@ describe('Zone', function() {
25052505
zone.run(() => {
25062506
const constraints = {audio: true, video: {width: 1280, height: 720}};
25072507

2508-
navigator.getUserMedia(
2509-
constraints,
2510-
() => {
2511-
expect(Zone.current.name).toEqual(zone.name);
2512-
done();
2513-
},
2514-
() => {
2515-
expect(Zone.current.name).toEqual(zone.name);
2516-
done();
2517-
});
2508+
try {
2509+
navigator.getUserMedia(
2510+
constraints,
2511+
() => {
2512+
expect(Zone.current.name).toEqual(zone.name);
2513+
done();
2514+
},
2515+
() => {
2516+
expect(Zone.current.name).toEqual(zone.name);
2517+
done();
2518+
});
2519+
} catch (error) {
2520+
console.log('getUserMedia error: ', error);
2521+
done();
2522+
}
25182523
});
25192524
}));
25202525
});

0 commit comments

Comments
 (0)