Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(817)

Unified Diff: LayoutTests/gamepad/gamepad-detached-no-crash.html

Issue 256593010: Gracefully support Navigator Gamepad methods in a detached state. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have document supplements keep a reference to their document Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/gamepad/gamepad-detached-no-crash-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/gamepad/gamepad-detached-no-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698