Changes

Jump to: navigation, search

Mouse Lock API Test Tracker

7,455 bytes added, 15:45, 29 February 2012
Review Issues [This list consists of older issues that were resolved]
* [[User:Diogogmt|Diogo Golovanevsky Monteiro]]
==Review Issues [This list consists of older issues that were resolved]==
 
* <s>Rewrite DOM node removal unlocking logic to use nsIMutatationObserver</s> humph, diogogmt
* <s>Space, bracing, tabs, etc style nits</s> humph
* <s>clientX, clientY, screenX, screenY values should follow spec as per [https://bugzilla.mozilla.org/show_bug.cgi?id=633602#c55 scheib's comment]</s> diogogmt
* <s>Confirm |aEvent->lastRefPoint = nsIntPoint(bounds.width/2, bounds.height/2);| that / 2 is right</s> diogogmt
* <s>"nsCOMPtr<nsIContent> mMouseLockedElement; - Shouldn't this be a static member variable? Or how does the patch handle cases when the document which has iframe and mouse moves over those iframes." Probably wants a test for this case, too.</s> diogogmt
* <s>"nsDOMMouseLockable::ShouldLock...QI to nsINode and check IsInDoc()"</s> diogogmt
* <s>"nsRefPtr<nsMouseLockableRequest> request = new nsMouseLockableRequest(aSuccessCallback, aFailureCallback); -- You should store aTarget (QI'ed to nsINode or nsIContent or Element or nsIDOMEventTarget) so that when calling callback you push Cx to stack; nsCxPusher pusher: // defined in nsContentUtils.h NS_ENSURE_STATE(pusher.Push(target));"</s> - humph
* <s>"nsDOMMouseLockable looks like it should be cycle collectable"</s> humph
* <s>Break .pointer out of Navigator, and add nsIDOMMozNavigatorPointer (not sure if this name is best) as a new interface to Navigator, similar to nsIDOMMozNavigatorBattery.</s> - humph, diogogmt
* <s>Rename for moz* prefix. The API should be probably prefixed. So, navigator.mozPointer and all the interfaces should start with nsIDOMMoz. Similar to what webkit* is doing:</s> - humph
** <s>navigator.webkitPointer.unlock();</s>
** <s>navigator.webkitPointer.lock();</s>
** <s>navigator.webkitPointer.isLocked();</s>
** <s>document.body.addEventListener("webkitpointerlocklost", ...</s>
** <s>mouseMoveEvent.webkitMovementX</s>
** <s>mouseMoveEvent.webkitMovementY</s>
* Follow discussion unfolding here for other changes: http://lists.w3.org/Archives/Public/public-webapps/2011OctDec/1558.html
* Finish tests, updated to changes above.
* <s>Update patch to trunk</s> - humph
* <s>Figure out why DOMMouseScroll events aren't being retargeted to the locked element</s> - humph, diogogmt
 
* <s>Look into roc's suggestion from bug 722449 comment 8, namely, using getBoundingClientRect vs. GetPrimaryFrame()</s> - diogogmt
 
* <s>Maybe use nsStubMutationObserver instead of nsIMutationObserver?</s> - humph
 
* <s>Extensions to the Document Interface. Add pointerLockElement attribute and exitPointerLock method</s> - diogogmt
 
* <s>Update Element interface to have requestPointerLock</s> - diogogmt
 
* <s>Dispatch pointerlockchange or pointerlockerror events instead of firing a callback when pointer gets locked</s> - diogogmt
 
* <s>Update mochitests to use new pointerlock API</s> - diogogmt
 
* Add expect number of tests to mochitests
* Update patch to trunk - diogogmt
 
==Mochitests for new PointerLock API==
 
To have consistency between all the tests they were updated to the following:
* Through out the test flags are set to represent success or failure
* runTests function will run the assertions using the flags
* All assertions are located in runTests()
* body onload calls start()
* start() waits for focus then start running the test
* If test uses fullscreen API, then runTests() and SimpleTest.finish() are called when fullscreen mode is cancelled
 
Structure of the tests(Top-Bottom):
# Test description
# SpecialPowers(if nedded)
# SimpleTest.waitForExplicitFinish()
# var declarations
# function runTests()
# Some code specific to the test
# pointerlockchange event listener
# pointerlockerror event listener
# mozfullscreenchange event listener
## runTests()
## SimpleTest.finish()
# function start()
 
 
 
{| border=1 style="border: 1px solid darkgray;"
| Num
| Name
| Reviewers
| Updated?
| Reviewed?
| Comments
|-
| 1
| <s>test_FullScreenHarness.html</s>
| diogogmt
| Removed
|
| Not needed anymore since now it's possible to request fullscreen on the mochitest iframe
|-
 
| 2
| <s>file_DOMtree.html</s>
| diogogmt
| Removed
|
|Split between test_withoutDOM and test_removedFromDOM
|-
 
| 2
| <b>test_withoutDOM.html</b>
| diogogmt
| New
|
| Checks if element is attached to the DOM Tree before locking the pointer
|-
 
| 2
| test_removedFromDOM.html</b>
| diogogmt
| New
|
| Checks if pointer is unlocked when element is removed from DOM Tree
|-
 
| 3
| <s>file_nestedFullScreen.html</s><br /><b>test_nestedFullScreen.html</b>
| diogogmt
| Upated
|
| Requesting fullscreen on a child element of the element with the pointer locked should unlock the pointer
|-
 
| 4
| <s>file_differentDOM.html</s>
| diogogmt
| Removed
|
| On the old spec the pointer object was attached to the navigator, so there was a possibility that an element belonging to a different DOM could request pointerlock. However, in the new API the element requests pointerlock on it self making this test redundant.
|-
 
| 5
| <s>file_fullscreen.html</s>
| diogogmt
| Removed
|
| Tested components of the old spec and had some redundant tests
|-
 
| 6
| <s>file_doubleLockCallBack.html</s><br /><b>test_doubleLock.html</b>
| diogogmt
| Renamed<br/>Updated
|
| If element requests pointerlock on itself while in pointerlock state mozpointerlockchange event should be dispatched
|-
 
| 8
| <s>file_exitMouseLockOnLoseFocus.htm</s><br /><b>test_looseFocusWindow.html</b>
| diogogmt
| Renamed<br />Updated
|
| If element has the pointer locked and window loses focus pointer should be unlocked
|-
 
| 10
| <s>file_pointerlocklost.html</s>
| diogogmt
| Removed
|
| On the new updated spec pointerlocklost event doesn't exist anymore
|-
 
| 11
| <s>file_movementXY.html</s><br /><b>test_movementXY.html</b>
| diogogmt
| Renamed<br />Updated
|
| Checks if mozMovementX and mozMovementY are present in the mouse event object. It also checks the values for mozMovementXY. They should be equal to the current screenXY minus the last screenXY
|-
 
| 12
| <s>file_targetOutOfFocus.html</s><br /><b>test_targetOutOfFocus</b>
| diogogmt
| Renamed<br />Updated
|
| Element doesn't need to have focus to request pointer lock
|-
 
| 13
| <s>test_MozPointerLock.html</s>
| diogogmt
| Removed
|
| On the new updated spec we don't have a MozPointerLock object anymore
|-
 
| 15
| <s>file_cursorPosEvents.html</s><br /><b>test_suppressSomeMouseEvents</b>
| diogogmt
| Renamed<br />Updated
|
| Test will check to make sure that the following mouse events are no longer executed in pointer lock. - mouseover, mouseout, mouseenter, mouseleave
|-
 
| 17
| <s>file_defaultUnlock.html</s><br /><b>test_escapeKey</b>
| diogogmt
| Renamed<br />Updated
|
| Escape key should unlock the pointer
|-
 
| 18
| <s>file_userPref.html</s><br /><b>test_pointerLockPref.html</b>
| diogogmt
| Renamed<br />Updated
|
| Tests full-screen-api.pointer-lock pref
|-
 
| 19
| <s>file_constantXY.html</s><br /><b>test_screenClientXYConst.html</b>
| diogogmt
| Renamed<br />Updated
|
| Confirm that screenX/Y and clientX/Y are constants when the pointer is locked.
|-
 
| 20
| <s>file_pointerLockCSSDisplay.html</s><br /><b>test_cssDisplayProperty.html</b>
| diogogmt
| Renamed<br />Updated
|
| Pointer should not be locked to an element with css property display is set to none
|-
 
| 21
| <s>file_retargetMouseEvents.html</s><br /><b>test_retargetMouseEvents</b>
| diogogmt
| Renamed<br />Updated
|
| Retarget mouse events to the locked element
|-
|}
==Test [as of 31st January, 2012]==
|
| Test on checking that events inside a locked element are re-targeted to the element in lock.
 
|-
|}
 ===Possible Test Cases===
New Tests (not sure if it will work on mochitest, and the test will possibly fail as dave is working on this patch)
# When there is a parent element with multiple child element, have a test to check that all mouse events fired inside the child element are suppressed and is captured by the parent element. (this may also include the scenario where there is an iframe in the parent element) - Being worked on by Diogogmt
# A Test to check that repeated move of the mouse to a certain direction that will exceed the screen size does not break the mouselock (this may conflict with file_movementXY.html and we may need to add more test cases) - Should be in file_movementXY.html
1
edit

Navigation menu