Closed Bug 1022618 Opened 10 years ago Closed 10 years ago

test_gallery_crop_photo is incorrectly asserting

Categories

(Firefox OS Graveyard :: Gaia::UI Tests, defect, P2)

x86_64
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: zcampbell, Assigned: dwong)

Details

Attachments

(1 file, 1 obsolete file)

The test_gallery_crop_photo is using assertLess to compare two strings.

This should be resolved to compare numbers or the assert changed entirely to assert that the image has been cropped.
Priority: -- → P2
I think I've come up with a solution for now by comparing the rendered areas of the images. As it's cropping a landscape photo to a portrait on a portrait phone the rendered area should increase as the rendered height is increased to fit the image. Though it might be too fragile as choosing different crop settings or images could break it. Is there an easy way to get the actual image heights and widths?
Assignee: nobody → dwong
Attachment #8437818 - Flags: review?(zcampbell)
Comment on attachment 8437818 [details] [review]
Proposed pr that adjusts assert to compare rendered image area

I think your hunch is correct that just looking at the size could be unreliable.

It might be safer just to return the scale as an [x, y] tuple which can then be asserted.
Attachment #8437818 - Flags: review?(zcampbell) → review-
Thanks Zac, I'll look into it, though I will wait on the status of Bug 1023305 as it seems to attempt to address the issue as well
I came back to this since I realized the 1.4 crop assert was a separate issue. But would you prefer just doing an assert less directly on the list/tuple or comparing them elementwise? It seems the scale's x, y properties x==y always.
Flags: needinfo?(zcampbell)
Erm, I forget that Python compares it elementwise anyways. Here is the new pull with the changes you asked for.
Attachment #8437818 - Attachment is obsolete: true
Attachment #8440161 - Flags: review?(zcampbell)
Flags: needinfo?(zcampbell)
Comment on attachment 8440161 [details] [review]
New PR adjusting current_scale to return a list of floats to represent scale x,y isntead of string

I am going to give this an r+
Attachment #8440161 - Flags: review+
Comment on attachment 8440161 [details] [review]
New PR adjusting current_scale to return a list of floats to represent scale x,y isntead of string

r+ thanks Dylan, sorry about the delay in reviewing it!
Attachment #8440161 - Flags: review?(zcampbell) → review+
Merged:
https://github.com/mozilla-b2g/gaia/commit/32c6a65f74ecf7d5d2d33c09fe2e85d31200a5b0
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: