Closed Bug 1149395 Opened 9 years ago Closed 9 years ago

Improve test case from bug 1146116 (mozSetFileArray recompartmenting)

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: jld, Assigned: jld)

References

Details

Attachments

(1 file)

The patch from bug 1146116 contains a test case which confirms that, after calling mozSetFileArray on an input element, the File object read back from it belongs to the element's global, even if the original File did not.  This part is working correctly.

The test also, as a sanity check, confirms that it did in fact pass a cross-origin File.  Unfortunately, this part is incorrect:

  isnot(SpecialPowers.Cu.getGlobalForObject(elem), window,
        "File from MessageManager is wrapped");

This test will never fail, because the return value of getGlobalForObject will be a Proxy (as for SpecialPowers.wrap), and will therefore not compare equal to any actual global; it has to be passed through SpecialPowers.unwrap, as is done for the second test.  It would also fail if it did that, because it's testing `elem` (the input element, which does belong to the script's global) rather than `file` (the cross-origin-wrapped File object).

Aside from being slightly embarrassing, this defeats the purpose of adding that check: to verify that the test is in fact testing what it's meant to be.
(This bug isn't really about *submitting* an HTML form, anymore.)
Component: HTML: Form Submission → DOM: Core & HTML
Rolling the magic 8-ball of DOM peers....
Attachment #8586435 - Flags: review?(mrbkap)
Comment on attachment 8586435 [details] [diff] [review]
bug1149395-oops-hg0.diff

Review of attachment 8586435 [details] [diff] [review]:
-----------------------------------------------------------------

Good catch.
Attachment #8586435 - Flags: review?(mrbkap) → review+
No try run for C-N because: it's a change to one specific test, and the changes shouldn't depend on platform.  Tested locally on x86_64/Linux desktop (e10s and not), and B2G emulator (non-debug) and emulator-x86-kk (debug).
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/82a14807801c
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: