Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Patch
Canonical link: https://commits.webkit.org/156494@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
66 changed files
with
1,513 additions
and
21 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
@@ -0,0 +1,10 @@ | ||
Tests that no callbacks are invoked until permission is allowed. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS Success callback invoked | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
description("Tests that no callbacks are invoked until permission is allowed."); | ||
window.jsTestIsAsync = true; | ||
|
||
function allowPermission() { | ||
permissionSet = true; | ||
if (window.testRunner) | ||
testRunner.setUserMediaPermission(true); | ||
} | ||
|
||
var options = {audio: true, video: true}; | ||
navigator.webkitGetUserMedia(options, function(stream) { | ||
if (permissionSet) { | ||
testPassed('Success callback invoked'); | ||
finishJSTest(); | ||
return; | ||
} | ||
testFailed('Success callback invoked unexpectedly'); | ||
}, function(e) { | ||
testFailed('Error callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}); | ||
|
||
window.setTimeout(allowPermission, 100); | ||
</script> | ||
<script src="../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
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
@@ -0,0 +1,10 @@ | ||
Tests that no callbacks are invoked until permission is denied. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS error.code is error.PERMISSION_DENIED | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
description("Tests that no callbacks are invoked until permission is denied."); | ||
window.jsTestIsAsync = true; | ||
|
||
function denyPermission() { | ||
permissionSet = true; | ||
if (window.testRunner) | ||
testRunner.setUserMediaPermission(false); | ||
} | ||
|
||
var error; | ||
var options = {audio: true, video: true}; | ||
navigator.webkitGetUserMedia(options, function(stream) { | ||
testFailed('Success callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}, function(e) { | ||
if (permissionSet) { | ||
error = e; | ||
shouldBe('error.code', 'error.PERMISSION_DENIED'); | ||
finishJSTest(); | ||
return; | ||
} | ||
testFailed('Error callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}); | ||
|
||
window.setTimeout(denyPermission, 100); | ||
</script> | ||
<script src="../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
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
@@ -0,0 +1,10 @@ | ||
Tests UserMedia error callback using the mock service. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS error.code is error.PERMISSION_DENIED | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
description("Tests UserMedia error callback using the mock service."); | ||
window.jsTestIsAsync = true; | ||
|
||
if (window.testRunner) | ||
testRunner.setUserMediaPermission(false); | ||
else | ||
debug('This test can not be run without the testRunner'); | ||
|
||
var error; | ||
var options = {audio:false, video:true}; | ||
navigator.webkitGetUserMedia(options, function(stream) { | ||
testFailed('Success callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}, function(e) { | ||
error = e; | ||
shouldBe('error.code', 'error.PERMISSION_DENIED'); | ||
finishJSTest(); | ||
}); | ||
</script> | ||
<script src="../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
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
@@ -0,0 +1,9 @@ | ||
Tests UserMedia success callback using the mock service. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
description("Tests UserMedia success callback using the mock service."); | ||
window.jsTestIsAsync = true; | ||
|
||
if (window.testRunner) | ||
testRunner.setUserMediaPermission(true); | ||
else | ||
debug('This test can not be run without the testRunner'); | ||
|
||
var options = {audio: true, video: true}; | ||
navigator.webkitGetUserMedia(options, function(stream) { | ||
finishJSTest(); | ||
}, function(e) { | ||
testFailed('Error callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}); | ||
</script> | ||
<script src="../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
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
@@ -0,0 +1,11 @@ | ||
CONSOLE MESSAGE: line 24: NotSupportedError: DOM Exception 9: The implementation did not support the requested type of object or operation. | ||
Tests that when a getUserMedia request is made after its frame has been disconnected, no callbacks are made and no crash occurs. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
webkitGetUserMedia called on object with disconnected Frame. | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
description("Tests that when a getUserMedia request is made after its frame has been disconnected, no callbacks are made and no crash occurs."); | ||
window.jsTestIsAsync = true; | ||
|
||
if (window.testRunner) | ||
testRunner.setUserMediaPermission(true); | ||
|
||
function onFirstIframeLoaded() { | ||
iframeNavigator = iframe.contentWindow.navigator; | ||
iframe.src = 'resources/disconnected-frame-already-inner2.html'; | ||
} | ||
|
||
var error; | ||
var options = {audio: true, video: true}; | ||
function onSecondIframeLoaded() { | ||
setTimeout(finishTest, 100); | ||
|
||
iframeNavigator.webkitGetUserMedia(options, function(stream) { | ||
testFailed('Success callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}, function(e) { | ||
testFailed('Error callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}); | ||
} | ||
|
||
function finishTest() { | ||
debug('webkitGetUserMedia called on object with disconnected Frame.'); | ||
finishJSTest(); | ||
} | ||
|
||
var iframe = document.createElement('iframe'); | ||
iframe.src = 'resources/disconnected-frame-already-inner1.html'; | ||
document.body.appendChild(iframe); | ||
</script> | ||
<script src="../../../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
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
@@ -0,0 +1,11 @@ | ||
frame "<!--framePath //<!--frame0-->-->" - has 1 onunload handler(s) | ||
Tests that when a request is made on a UserMedia object and its Frame is disconnected before a callback is made, the error callback is invoked with the correct error message. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS No callbacks invoked | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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
@@ -0,0 +1,13 @@ | ||
frame "<!--framePath //<!--frame0-->-->" - has 1 onunload handler(s) | ||
Tests that when a getUserMedia request is made, permission is denied and its Frame is disconnected before a callback is made, the error callback is invoked with PERMISSION_DENIED. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS error.code is error.PERMISSION_DENIED | ||
|
||
PASS No callbacks invoked | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
description("Tests that when a getUserMedia request is made, permission is denied and its Frame is disconnected before a callback is made, the error callback is invoked with PERMISSION_DENIED."); | ||
window.jsTestIsAsync = true; | ||
|
||
if (window.testRunner) | ||
testRunner.setUserMediaPermission(false); | ||
else | ||
debug('This test can not be run without the testRunner'); | ||
|
||
var error; | ||
var options = {audio: true, video: true}; | ||
function onIframeLoaded() { | ||
iframeNavigator = iframe.contentWindow.navigator; | ||
iframeNavigator.webkitGetUserMedia(options, function(stream) { | ||
testFailed('Success callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}, function(e) { | ||
error = e; | ||
shouldBe('error.code', 'error.PERMISSION_DENIED'); | ||
debug(''); | ||
iframe.src = 'data:text/html,This frame should be visible when the test completes'; | ||
}); | ||
} | ||
|
||
function onIframeUnloaded() { | ||
// Make another request, with permission already denied. | ||
iframeNavigator.webkitGetUserMedia(options, function(stream) { | ||
testFailed('Success callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}, function(e) { | ||
testFailed('Error callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}); | ||
setTimeout(function() { | ||
testPassed('No callbacks invoked'); | ||
finishJSTest(); | ||
}, 100); | ||
} | ||
|
||
var iframe = document.createElement('iframe'); | ||
iframe.src = 'resources/disconnected-frame-inner.html'; | ||
document.body.appendChild(iframe); | ||
|
||
</script> | ||
<script src="../../../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
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
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
description("Tests that when a request is made on a UserMedia object and its Frame is disconnected before a callback is made, the error callback is invoked with the correct error message."); | ||
window.jsTestIsAsync = true; | ||
|
||
if (window.testRunner) | ||
testRunner.setUserMediaPermission(true); | ||
|
||
function onIframeLoaded() { | ||
iframeNavigator = iframe.contentWindow.navigator; | ||
iframe.src = 'data:text/html,This frame should be visible when the test completes'; | ||
} | ||
|
||
function onIframeUnloaded() { | ||
var options = {audio: true, video: true}; | ||
iframeNavigator.webkitGetUserMedia(options, function (stream) { | ||
testFailed('Success callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}, function(e) { | ||
testFailed('Error callback invoked unexpectedly'); | ||
finishJSTest(); | ||
}); | ||
|
||
setTimeout(function() { | ||
testPassed('No callbacks invoked'); | ||
finishJSTest(); | ||
}, 100); | ||
} | ||
|
||
var iframe = document.createElement('iframe'); | ||
iframe.src = 'resources/disconnected-frame-inner.html'; | ||
document.body.appendChild(iframe); | ||
|
||
</script> | ||
<script src="../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
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
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
<body onload="window.parent.onFirstIframeLoaded()"> | ||
<p>This frame should be replaced before the test ends</p> | ||
</body> | ||
</html> |
Oops, something went wrong.