Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test navigator.getUserMedia success callback is triggered when user allo... #160

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<title>getUserMedia: test the success callback is triggered when user allows access to video stream</title>
<link rel="author" title="Kyle Barrow" href="mailto:[email protected]">
<link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html">
<meta name="assert" content="the success callback is triggered when user allows access to video stream">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" href="/resources/testharness.css">

</head>
<body>
<p>When prompted, <strong>please allow</strong> access to the video stream.</p>

<div id="log"></div>
<script>

var t = async_test("Test the success callback is triggered when user allows access to video stream", {timeout:10000});

t.step(function() {
navigator.getUserMedia(
{video: true},
t.step_func(function() {
assert_true(true);
t.done();
}),
t.step_func(function() {
assert_unreached("The error callback should not have been triggered since access is to be allowed");
t.done();
})
);
});



</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html>
<head>
<title>MediaStream: test MediaStream.currentTime</title>
<link rel="author" title="Kyle Barrow" href="mailto:[email protected]">
<link rel="help" href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html">
<meta name="assert" content="the current time of the media stream">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="stylesheet" href="/resources/testharness.css">

<style>

video {
width: 50%;
}

</style>
</head>
<body>
<p>When prompted, <strong>please allow</strong> access to the video stream.</p>
<div id="log"></div>
<script>

var t = async_test("Test MediaStream.currentTime", {timeout:10000});

t.step(function() {
navigator.getUserMedia(
{video: true},
t.step_func(function(stream) {
assert_true(stream.currentTime >= 0, "Test MediaStream.currentTime is an interger >= 0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentTime is a property of the video element in which a stream can be plugged, not the stream itself, so that test doesn't seem valid

stream.currentTime = 1000
assert_true(stream.currentTime < 1000, "Test MediaStream.currentTime is read only")
t.done();
}),
t.step_func(function() {
assert_unreached("The error callback should not have been triggered as user should allow access");
t.done();
})
);
});



</script>
</body>
</html>