Closed Bug 853909 Opened 12 years ago Closed 12 years ago

No test code exists yet for rotation gesture

Categories

(Firefox :: General, defect)

21 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 22

People

(Reporter: waterlo1, Assigned: waterlo1)

Details

Attachments

(1 file, 2 obsolete files)

No test code exists yet for image rotation gesture.
Assignee: nobody → waterlo1
See also bug 833511
Attached patch Proposed Patch v0.1 (obsolete) — Splinter Review
This patch will test image rotation 32 times-- -At each 90-degree initial rotation (4 ways) -Clockwise and counter clockwise (2 ways) -More and less than 45 degrees rotated (2 ways) -Stopping before end of gesture (so primitive nearest-snap occurs) and not stopping (so momentum snapping occurs) (2 ways) 4*2*2*2 = 32. Test code is all in browser/base/content/test/browser_gestureSupport.js. Test is now async, requires explicit finish.
Attachment #728298 - Flags: feedback?(jAwS)
Status: NEW → ASSIGNED
Comment on attachment 728298 [details] [diff] [review] Proposed Patch v0.1 Review of attachment 728298 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/base/content/test/browser_gestureSupport.js @@ +545,5 @@ > + > + // Force the current rotation on the image, update gGestureSupport so it isn't > + // confused, and force flush > + aImageElement.style.transform = "rotate(" + aCurrentRotation +"deg)"; > + gGestureSupport.rotation = aCurrentRotation; Hm, it would be better if gGestureSupport didn't need to be mucked with here. @@ +608,5 @@ > + let clockwise = SimpleGestureEvent.ROTATION_CLOCKWISE; > + let cclockwise = SimpleGestureEvent.ROTATION_COUNTERCLOCKWISE; > + > + let imgElem = content.document.body && > + content.document.body.firstElementChild; nit, weird indentation here. you can just align the two content.document's. @@ +640,5 @@ > +{ > + test_imageTab = gBrowser.addTab("chrome://branding/content/about-logo.png"); > + gBrowser.selectedTab = test_imageTab; > + > + gBrowser.getBrowserForTab(test_imageTab) You can use gBrowser.selectedBrowser here.
Attachment #728298 - Flags: feedback?(jAwS) → feedback+
Attached patch Proposed Patch v0.2 (obsolete) — Splinter Review
This patch incorporates jaws' feedback. In order to test at all four possible initial orientations, it is necessary to manually set the rotation--in this case a simple 90 degree clockwise rotate gesture was performed. This is seen at the end of the loop. This manual alteration to rotation is not tested, but if any errors occurred, they would be caught by later tests. The eight gestures performed in the loop (excluding the final manual set gesture) cancel each other out in total--so given an initial rotation of x, the final rotation after all 8 gestures will be x.
Attachment #728298 - Attachment is obsolete: true
Attachment #729198 - Flags: feedback?(jAwS)
Comment on attachment 729198 [details] [diff] [review] Proposed Patch v0.2 Review of attachment 729198 [details] [diff] [review]: ----------------------------------------------------------------- I ran the tests on Windows and it looks good from here. ::: browser/base/content/test/browser_gestureSupport.js @@ +557,5 @@ > + let stopExpectedRotation = (aCurrentRotation + delta) % 360; > + if (stopExpectedRotation < 0) > + stopExpectedRotation += 360; > + > + ok(stopExpectedRotation == test_rotateHelperGetImageRotation(aImageElement), is(lhs, rhs, ...) @@ +583,5 @@ > + if (finalExpectedRotation < 0) > + finalExpectedRotation += 360; > + } > + > + ok(finalExpectedRotation == test_rotateHelperGetImageRotation(aImageElement), is(lhs, rhs, ...) @@ +593,5 @@ > +} > + > +function test_rotateGesturesOnTab() > +{ > + gBrowser.getBrowserForTab(test_imageTab) This is just gBrowser.selectedBrowser
Attachment #729198 - Flags: feedback?(jAwS) → feedback+
Attached patch Proposed PatchSplinter Review
This version of the patch incorporates jaws' previous feedback.
Attachment #729198 - Attachment is obsolete: true
Attachment #729504 - Flags: feedback?(jAwS)
Attachment #729504 - Flags: feedback?(jAwS) → review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: