Closed Bug 1168326 Opened 9 years ago Closed 9 years ago

Replace SpecialPowers in selection_helper.js

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gduan, Assigned: chenpighead)

Details

Attachments

(3 files, 1 obsolete file)

SpecialPowers has been removed from marionette (might related to bug 1149618).
We need a new way to get intput/textarea 's selection and enable disabled marionette test cases.
(In reply to George Duan [:gduan] [:喬智] from comment #0)
> SpecialPowers has been removed from marionette (might related to bug
> 1149618).
> We need a new way to get intput/textarea 's selection and enable disabled
> marionette test cases.

I tried the new way, which uses client.scope({ context: 'chrome' }).executeScript(script, [args]), but failed to pass element into script. I can pass string, int, even element's attribute, just can't pass element itself. Still figuring it out.
SpecialPowers has been removed from marionette in bug 1149618, but somehow SpecialPowers was not removed in selection_helper.js yet. To remove that, we could enable parameter "sandbox" for executeScript(), which is already enabled in Marionette Python Client. In my first commit, I enable parameter "sandbox" for executeScript() and fix the unit-test. In my second commit, I use the newly supported executeScript() to remove the use of SpecialPowers.
Assignee: nobody → jeremychen
Comment on attachment 8615175 [details] [review]
PR

Hi Gareth, could you check this patch? Thanks.
Attachment #8615175 - Flags: review?(gaye)
Comment on attachment 8615175 [details] [review]
PR

Remove review request first. I'll split the PR into two separate parts: one for test file and one for marionette-client library. Then, I'll send review requests.
Attachment #8615175 - Flags: review?(gaye)
SpecialPowers has been removed from marionette in bug 1149618, but somehow SpecialPowers was not removed in selection_helper.js yet. To remove that, we could use parameter "sandbox" for executeScript(), which is already enabled in Marionette Python Client.

This patch could be check-in once the patch for JSmarionette (gaia/marionette-js-client and node_modules) is r+ and landed.
Attachment #8615175 - Attachment is obsolete: true
Attachment #8615847 - Flags: review?(gduan)
Enable parameter "sandbox" for executeScript(), which is already enabled in Marionette Python Client. The unit-test is also patched. With this patch, we can execute script with system privilege in marionette-js-client.
Attachment #8615849 - Flags: review?(gaye)
This patch is for gaia node_modules so we can test Gij manually.
Comment on attachment 8615847 [details] [review]
[gaia] PR to Gij test file

Thank you for fixing it. I have no concern for gaia part if the tests pass. Please make sure your patch to marionette-client is landed first.
Attachment #8615847 - Flags: review?(gduan) → review+
Comment on attachment 8615849 [details] [review]
[gaia] PR to jsmarionette/client/marionette-client

LGTM!
Attachment #8615849 - Flags: review?(gaye) → review+
Landed on master https://github.com/mozilla-b2g/gaia/commit/37868e7816290f1c92e180fda4dad6f5c0cee855
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Patch to marionette-client has been landed a while. Since test result for Gaia test file looks positive, please land the "[gaia] PR to Gij test file". Thanks. :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: