| Index: LayoutTests/gamepad/gamepad-detached-no-crash.html
|
| diff --git a/LayoutTests/webaudio/scriptprocessornode-downmix8-2channel-input.html b/LayoutTests/gamepad/gamepad-detached-no-crash.html
|
| similarity index 19%
|
| copy from LayoutTests/webaudio/scriptprocessornode-downmix8-2channel-input.html
|
| copy to LayoutTests/gamepad/gamepad-detached-no-crash.html
|
| index 86a89a3d0546f0042061f8cabf6f05b410590bec..1f474e0d41375561f8e6e1b0d019ceee87a8abed 100644
|
| --- a/LayoutTests/webaudio/scriptprocessornode-downmix8-2channel-input.html
|
| +++ b/LayoutTests/gamepad/gamepad-detached-no-crash.html
|
| @@ -1,40 +1,31 @@
|
| -<!DOCTYPE html>
|
| -
|
| -<html>
|
| -<head>
|
| +<!DOCTYPE HTML>
|
| <script src="../resources/js-test.js"></script>
|
| -<script src="resources/compatibility.js"></script>
|
| -<script src="resources/audio-testing.js"></script>
|
| -<script type="text/javascript" src="resources/scriptprocessornode-testing.js"></script>
|
| -</head>
|
| -
|
| -<body>
|
| -
|
| -<div id="description"></div>
|
| -<div id="console"></div>
|
| -
|
| <script>
|
| -description("Tests downmixing an 8-channel source connected to a JavaScriptAudioNode with 2-channel input.");
|
| -
|
| -var sampleRate = 44100.0;
|
| -var sourceChannels = 8;
|
| -var inputChannels = 2;
|
| -var outputChannels = 6;
|
| +description("Accessing Navigator Gamepad methods on a closed window.");
|
| +
|
| +window.jsTestIsAsync = true;
|
| +
|
| +var expectedLength = 0;
|
| +var w;
|
| +function processMessage(event) {
|
| + if (event.data == "opened") {
|
| + w.close();
|
| + } else if (event.data == "closed") {
|
| + shouldBe("w.navigator.getGamepads().length", "expectedLength");
|
| + finishJSTest();
|
| + }
|
| +}
|
|
|
| -function runTest() {
|
| +if (window.gamepadController) {
|
| if (window.testRunner) {
|
| testRunner.dumpAsText();
|
| + testRunner.setCanOpenWindows();
|
| testRunner.waitUntilDone();
|
| }
|
| -
|
| - window.jsTestIsAsync = true;
|
| -
|
| - runJSNodeTest();
|
| + w = window.open('resources/gamepad-detached-no-crash-new-window.html');
|
| + expectedLength = w.navigator.getGamepads().length;
|
| + window.addEventListener("message", processMessage, false);
|
| +} else {
|
| + console.log("FAIL: no gamepad controller available.")
|
| }
|
| -
|
| -runTest();
|
| -
|
| </script>
|
| -
|
| -</body>
|
| -</html>
|
|
|