Closed Bug 839519 Opened 13 years ago Closed 12 years ago

test_XHR_parameters.html test failing, because it needs "systemXHR" permission

Categories

(Core :: DOM: Device Interfaces, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: martijn.martijn, Assigned: martijn.martijn)

References

Details

Attachments

(2 files)

I'm seeing this failure in mochitest B2G: 61 INFO TEST-PASS | /tests/content/base/test/test_XHR_parameters.html | passed {"mozAnon":1} 62 ERROR TEST-UNEXPECTED-FAIL | /tests/content/base/test/test_XHR_parameters.html | testing mozAnon, - got false, expected true This is happening because SpecialPowers.addPermission("systemXHR", true, document); doesn't work for child process in oop b2g. Permissions can't be changed on the fly for inside an app, so this needs to be done beforehand, somehow. So, iiuc, with bug 814140, we have the ability to add these kinds of permissions in the manifest file. With the patch in that bug, I don't see "systemXHR" mentioned, so it could just be a matter of adding that permission to the manifest file to fix this test failure. (thanks for Jlebar and Andrea Marchesini for the explanation)
Attached patch add systemXHRSplinter Review
This didn't solve the bug, I don't know why, I thought it would work.
systemXHR is used everywhere and not network-http, so I think Permission.txt needs to be changed here.
Attachment #715707 - Flags: review?(anygregor)
Comment on attachment 715701 [details] [diff] [review] add systemXHR David, this line should be added anyway, right? Even though it doesn't seem to help for this bug.
Attachment #715701 - Flags: review?(dclarke)
martijn that is correct. However unsure what piece doesn't seem to work for this bug.
#1 make sure you have rebuilt tree after making permission change. #2 make sure you have a metadata.json file in same directory as manifest.webapp
David, I did do a complete rebuild of b2g with ./build.sh. That didn't help. I see a metadata.json file as well as the manifest.webapp file in gaia/external-apps/mochitest/ The testing/mochitest/manifest.webapp seems to be the only manifest.webapp file in the tree. Or is there something else that I need to change? A rebuild doesn't seem to change the same file in gaia/external-apps/mochitest/ .
TEST-PASS | unknown test url | passed undefined TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed null TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed {} TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed {"mozSystem":""} TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed {"mozSystem":0} TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed {"mozAnon":1} TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed {"mozAnon":[]} TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed {"mozAnon":true} TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed 0 TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed 7 TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed 3.141592653589793 TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed "string" TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed true TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | passed false TEST-PASS | unknown test url | testing mozAnon TEST-PASS | unknown test url | testing mozSystem TEST-PASS | unknown test url | invalid parameter raised exception as expected: "Bla" test seem to be passing, .. the rebuild doesn't change the test file, it builds a new gaia with the permissions as set.. i think something is getting cached in your objdir directory .. most likely need to make sure gaia is being rebuilt after the permissions change. a simple build.sh wasn't working for me, when i put in a printf, the rebuild worked, so would recommend rm -rf objdir-gecko, or some other mechanism to make sure gaia gets built and used with the emulator
Comment on attachment 715701 [details] [diff] [review] add systemXHR Review of attachment 715701 [details] [diff] [review]: ----------------------------------------------------------------- works for me
Attachment #715701 - Flags: review?(dclarke) → review+
Attachment #715707 - Flags: review?(anygregor) → review+
I did do a rm -rf objdir-gecko and a rebuild, but I still get 5 errors with that test. Anyway, the patches are still ok to be checked in.
Keywords: checkin-needed
can you push this patch to try server?
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: