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

Side by Side 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, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/gamepad/gamepad-detached-no-crash-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE HTML>
2 <script src="../resources/js-test.js"></script>
3 <script>
4 description("Accessing Navigator Gamepad methods on a closed window.");
2 5
3 <html> 6 window.jsTestIsAsync = true;
4 <head>
5 <script src="../resources/js-test.js"></script>
6 <script src="resources/compatibility.js"></script>
7 <script src="resources/audio-testing.js"></script>
8 <script type="text/javascript" src="resources/scriptprocessornode-testing.js"></ script>
9 </head>
10 7
11 <body> 8 var expectedLength = 0;
9 var w;
10 function processMessage(event) {
11 if (event.data == "opened") {
12 w.close();
13 } else if (event.data == "closed") {
14 shouldBe("w.navigator.getGamepads().length", "expectedLength");
15 finishJSTest();
16 }
17 }
12 18
13 <div id="description"></div> 19 if (window.gamepadController) {
14 <div id="console"></div>
15
16 <script>
17 description("Tests downmixing an 8-channel source connected to a JavaScriptAudio Node with 2-channel input.");
18
19 var sampleRate = 44100.0;
20 var sourceChannels = 8;
21 var inputChannels = 2;
22 var outputChannels = 6;
23
24 function runTest() {
25 if (window.testRunner) { 20 if (window.testRunner) {
26 testRunner.dumpAsText(); 21 testRunner.dumpAsText();
22 testRunner.setCanOpenWindows();
27 testRunner.waitUntilDone(); 23 testRunner.waitUntilDone();
28 } 24 }
29 25 w = window.open('resources/gamepad-detached-no-crash-new-window.html');
30 window.jsTestIsAsync = true; 26 expectedLength = w.navigator.getGamepads().length;
31 27 window.addEventListener("message", processMessage, false);
32 runJSNodeTest(); 28 } else {
29 console.log("FAIL: no gamepad controller available.")
33 } 30 }
34
35 runTest();
36
37 </script> 31 </script>
38
39 </body>
40 </html>
OLDNEW
« 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