Changeset 122158 in webkit
- Timestamp:
- Jul 9, 2012 2:19:26 PM (12 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r122152 r122158 1 2012-07-09 Vincent Scheib <scheib@chromium.org> 2 3 Refactor common Pointer Lock test code to a harness. 4 https://bugs.webkit.org/show_bug.cgi?id=90813 5 6 Reviewed by Adrienne Walker. 7 8 * pointer-lock/bug90391-move-then-window-open-crash-expected.txt: 9 * pointer-lock/bug90391-move-then-window-open-crash.html: 10 * pointer-lock/lock-already-locked-expected.txt: 11 * pointer-lock/lock-already-locked.html: 12 * pointer-lock/lock-fail-responses-expected.txt: 13 * pointer-lock/lock-fail-responses.html: 14 * pointer-lock/mouse-event-delivery-expected.txt: 15 * pointer-lock/mouse-event-delivery.html: 16 * pointer-lock/pointer-lock-api-expected.txt: 17 * pointer-lock/pointer-lock-api.html: 18 * pointer-lock/pointerlockchange-pointerlockerror-events-expected.txt: 19 * pointer-lock/pointerlockchange-pointerlockerror-events.html: 20 * pointer-lock/pointerlocklost-event-expected.txt: 21 * pointer-lock/pointerlocklost-event.html: 22 * pointer-lock/resources/pointer-lock-test-harness.js: Added. 23 (doNextStep.else): 24 (doNextStepWithUserGesture): 25 (eventExpected.targetHanderNode.eventHandlerName): 26 (eventExpected): 27 (expectOnlyChangeEvent): 28 (expectOnlyErrorEvent): 29 (expectNoEvents): 30 1 31 2012-07-09 Dean Jackson <dino@apple.com> 2 32 -
trunk/LayoutTests/pointer-lock/bug90391-move-then-window-open-crash-expected.txt
r121909 r122158 12 12 13 13 TEST COMPLETE 14 doNextStep for manual testing15 14 -
trunk/LayoutTests/pointer-lock/bug90391-move-then-window-open-crash.html
r121909 r122158 3 3 <head> 4 4 <script src="../fast/js/resources/js-test-pre.js"></script> 5 <script src="resources/pointer-lock-test-harness.js"></script> 5 6 </head> 6 7 <body> 7 8 <div> 8 <button onclick="doNextStep('manual');">doNextStep for manual testing</button>9 9 <div id="target1"></div> 10 10 </div> … … 15 15 targetdiv1 = document.getElementById("target1"); 16 16 17 currentStep = 0;18 function doNextStep(manual)19 {20 if (!window.layoutTestController && !manual)21 return;22 if (currentStep < todo.length)23 setTimeout(function () { todo[currentStep++](); }, 0);24 else if (currentStep++ == todo.length)25 setTimeout(function () { finishJSTest(); }, 0);26 }27 17 todo = [ 28 18 function () { … … 32 22 document.onwebkitpointerlockchange = null; 33 23 testPassed("document.onwebkitpointerlockchange event received."); 34 doNextStep( 'manual');24 doNextStep(); 35 25 }; 36 26 }, … … 41 31 if (++mouseMoveEvents == 2) { 42 32 targetdiv1.onmousemove = null; 43 doNextStep( 'manual');33 doNextStep(); 44 34 } 45 35 } … … 55 45 testPassed("Didn't crash"); 56 46 document.webkitExitPointerLock(); 57 doNextStep( 'manual');47 doNextStep(); 58 48 }, 59 49 ]; 60 doNextStep ();50 doNextStepWithUserGesture(); 61 51 </script> 62 52 <script src="../fast/js/resources/js-test-post.js"></script> -
trunk/LayoutTests/pointer-lock/lock-already-locked-expected.txt
r120486 r122158 32 32 33 33 TEST COMPLETE 34 doNextStep for manual testing35 34 -
trunk/LayoutTests/pointer-lock/lock-already-locked.html
r120486 r122158 3 3 <head> 4 4 <script src="../fast/js/resources/js-test-pre.js"></script> 5 <script src="resources/pointer-lock-test-harness.js"></script> 5 6 </head> 6 7 <body> 7 8 <div> 8 <button onclick="doNextStep('manual');">doNextStep for manual testing</button>9 9 <div id="target1"></div> 10 10 <div id="target2"></div> … … 23 23 testPassed("document.onwebkitpointerlockchange event received."); 24 24 shouldBe("document.webkitPointerLockElement", expectedTargetToBeLockedString); 25 doNextStep ();25 doNextStepWithUserGesture(); 26 26 }; 27 27 document.onwebkitpointerlockerror = … … 36 36 function () { shouldBe("expectTarget2Unlock", "true"); }); 37 37 38 currentStep = 0;39 function doNextStep(manual)40 {41 if (!window.layoutTestController && !manual)42 return;43 if (currentStep < todo.length)44 setTimeout(function () { todo[currentStep++](); }, 0);45 else if (currentStep++ == todo.length)46 setTimeout(function () { finishJSTest(); }, 0);47 }48 38 todo = [ 49 39 function () { … … 111 101 }, 112 102 ]; 113 doNextStep ();103 doNextStepWithUserGesture(); 114 104 </script> 115 105 <script src="../fast/js/resources/js-test-post.js"></script> -
trunk/LayoutTests/pointer-lock/lock-fail-responses.html
r120417 r122158 3 3 <head> 4 4 <script src="../fast/js/resources/js-test-pre.js"></script> 5 <script src="resources/pointer-lock-test-harness.js"></script> 5 6 </head> 6 7 <body> … … 10 11 shouldBeDefined("window.testRunner"); 11 12 12 currentStep = 0;13 function doNextStep() {14 todo[currentStep++]();15 }16 13 todo = [ 17 14 function () { … … 24 21 function () { 25 22 testPassed("Lock failed (after we called testRunner.setPointerLockWillFailSynchronously)"); 26 doNextStep ();23 doNextStepWithUserGesture(); 27 24 }); 28 25 }, … … 39 36 }); 40 37 }, 41 finishJSTest42 38 ]; 43 doNextStep ();39 doNextStepWithUserGesture(); 44 40 </script> 45 41 <script src="../fast/js/resources/js-test-post.js"></script> -
trunk/LayoutTests/pointer-lock/mouse-event-delivery-expected.txt
r120486 r122158 33 33 34 34 TEST COMPLETE 35 doNextStep for manual testing36 35 -
trunk/LayoutTests/pointer-lock/mouse-event-delivery.html
r120486 r122158 3 3 <head> 4 4 <script src="../fast/js/resources/js-test-pre.js"></script> 5 <script src="resources/pointer-lock-test-harness.js"></script> 5 6 </head> 6 7 <body id="body"> 7 8 <div> 8 <button onclick="doNextStep('manual');">doNextStep for manual testing</button>9 9 <div id="target1"></div> 10 10 <div id="target2"></div> … … 23 23 testPassed("document.onwebkitpointerlockchange event received."); 24 24 shouldBe("document.webkitPointerLockElement", expectedTargetToBeLockedString); 25 doNextStep( 'manual');25 doNextStep(); 26 26 }; 27 27 document.onwebkitpointerlockerror = … … 36 36 } 37 37 38 currentStep = 0;39 function doNextStep(manual)40 {41 if (!window.layoutTestController && !manual)42 return;43 if (currentStep < todo.length)44 setTimeout(function () { todo[currentStep++](); }, 0);45 else if (currentStep++ == todo.length)46 setTimeout(function () { finishJSTest(); }, 0);47 }48 38 todo = [ 49 39 function () { … … 62 52 window.eventSender.mouseUp(); 63 53 } 64 doNextStep ();54 doNextStepWithUserGesture(); 65 55 }, 66 56 function () { … … 79 69 window.eventSender.mouseUp(); 80 70 } 81 doNextStep ();71 doNextStepWithUserGesture(); 82 72 }, 83 73 function () { … … 104 94 window.eventSender.mouseUp(); 105 95 } 106 doNextStep ();96 doNextStepWithUserGesture(); 107 97 }, 108 98 ]; 109 doNextStep ();99 doNextStepWithUserGesture(); 110 100 </script> 111 101 <script src="../fast/js/resources/js-test-post.js"></script> -
trunk/LayoutTests/pointer-lock/pointer-lock-api-expected.txt
r120486 r122158 18 18 19 19 TEST COMPLETE 20 doNextStep for manual testing 20 -
trunk/LayoutTests/pointer-lock/pointer-lock-api.html
r120486 r122158 3 3 <head> 4 4 <script src="../fast/js/resources/js-test-pre.js"></script> 5 <script src="resources/pointer-lock-test-harness.js"></script> 5 6 </head> 6 7 <body> 7 <button onclick="doNextStep('manual');">doNextStep for manual testing</button>8 8 <script> 9 9 description("Basic API existence test for Pointer Lock.") 10 10 window.jsTestIsAsync = true; 11 11 12 currentStep = 0;13 function doNextStep(manual)14 {15 if (!window.testRunner && !manual)16 return;17 if (currentStep < todo.length)18 setTimeout(function () { todo[currentStep++](); }, 0);19 else if (currentStep++ == todo.length)20 setTimeout(function () { finishJSTest(); }, 0);21 }22 12 todo = [ 23 13 function () { … … 44 34 }, 45 35 ]; 46 doNextStep ();36 doNextStepWithUserGesture(); 47 37 </script> 48 38 <script src="../fast/js/resources/js-test-post.js"></script> -
trunk/LayoutTests/pointer-lock/pointerlockchange-pointerlockerror-events-expected.txt
r120486 r122158 37 37 38 38 TEST COMPLETE 39 doNextStep for manual testing40 39 -
trunk/LayoutTests/pointer-lock/pointerlockchange-pointerlockerror-events.html
r120486 r122158 3 3 <head> 4 4 <script src="../fast/js/resources/js-test-pre.js"></script> 5 <script src="resources/pointer-lock-test-harness.js"></script> 5 6 </head> 6 7 <body> 7 8 <div> 8 <button onclick="doNextStep('manual');">doNextStep for manual testing</button>9 9 <div id="target1"></div> 10 10 <div id="target2"></div> … … 21 21 targetIframe2 = document.getElementById("iframe2"); 22 22 23 function eventExpected(eventHandlerName, message, expectedCalls, targetHanderNode)24 {25 targetHanderNode[eventHandlerName] = function ()26 {27 switch (expectedCalls--) {28 case 0:29 testFailed(eventHandlerName + " received after: " + message);30 finishJSTest();31 break;32 case 1:33 doNextStep();34 default:35 testPassed(eventHandlerName + " received after: " + message);36 };37 };38 };39 40 function expectOnlyChangeEvent(message, targetDocument) {41 debug(" " + message);42 targetDocument = targetDocument !== undefined ? targetDocument : document;43 eventExpected("onwebkitpointerlockchange", message, 1, targetDocument);44 eventExpected("onwebkitpointerlockerror", message, 0, targetDocument);45 };46 47 function expectOnlyErrorEvent(message, targetDocument) {48 debug(" " + message);49 targetDocument = targetDocument !== undefined ? targetDocument : document;50 eventExpected("onwebkitpointerlockchange", message, 0, targetDocument);51 eventExpected("onwebkitpointerlockerror", message, 1, targetDocument);52 };53 54 function expectNoEvents(message, targetDocument) {55 debug(" " + message);56 targetDocument = targetDocument !== undefined ? targetDocument : document;57 eventExpected("onwebkitpointerlockchange", message, 0, targetDocument);58 eventExpected("onwebkitpointerlockerror", message, 0, targetDocument);59 };60 61 currentStep = 0;62 function doNextStep(manual)63 {64 if (!window.testRunner && !manual)65 return;66 if (currentStep < todo.length)67 setTimeout(function () { todo[currentStep++](); }, 0);68 else if (currentStep++ == todo.length)69 setTimeout(function () { finishJSTest(); }, 0);70 }71 23 todo = [ 72 24 function () { 73 25 expectNoEvents("Unlock."); 74 26 document.webkitExitPointerLock(); 75 doNextStep ();27 doNextStepWithUserGesture(); 76 28 }, 77 29 function () { -
trunk/LayoutTests/pointer-lock/pointerlocklost-event.html
r120417 r122158 3 3 <head> 4 4 <script src="../fast/js/resources/js-test-pre.js"></script> 5 <script src="resources/pointer-lock-test-harness.js"></script> 5 6 </head> 6 7 <body> … … 49 50 } 50 51 51 currentStep = 0;52 function doNextStep() {53 setTimeout(function () { todo[currentStep++](); }, 0);54 }55 52 todo = [ 56 53 function () { … … 75 72 shouldBe("document.webkitPointerLockElement", "null"); 76 73 shouldBe("navigator.webkitPointer.isLocked", "false"); 77 doNextStep ();74 doNextStepWithUserGesture(); 78 75 }, 79 76 function () { … … 101 98 doNextStep(); 102 99 }, 103 finishJSTest104 100 ]; 105 doNextStep ();101 doNextStepWithUserGesture(); 106 102 </script> 107 103 <script src="../fast/js/resources/js-test-post.js"></script>
Note: See TracChangeset
for help on using the changeset viewer.