Closed Bug 751783 Opened 12 years ago Closed 12 years ago

Save globals between execute_script calls in the 'content' context

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla15

People

(Reporter: jgriffin, Assigned: philikon)

Details

Attachments

(1 file, 1 obsolete file)

Currently, each call to execute_script or execute_async_script uses a new sandbox, so the sandbox globals are not carried over, and the only way to share state between calls is to use a property on the window object.

This contaminates the page's JS context, and makes it a little more work to write tests.  We should preserve globals between calls, so that this isn't necessary.
Assignee: nobody → philipp
Attachment #621828 - Flags: review?(jgriffin)
Patch looks good to me! We just need to make sure it doesn't break any of the tests
Added the newSandbox argument to execute* calls to preserve functionality with Selenium, and updated the tests.
Attachment #621828 - Attachment is obsolete: true
Attachment #621828 - Flags: review?(jgriffin)
Attachment #622449 - Flags: review?(jgriffin)
Comment on attachment 622449 [details] [diff] [review]
Part 1 (v2): Reuse the content sandbox

Looks good, and tests pass!  Let's land it and then we can update the chrome code in a separate patch.
Attachment #622449 - Flags: review?(jgriffin) → review+
http://hg.mozilla.org/mozilla-central/rev/b54871d38ed1
Target Milestone: --- → mozilla15
(In reply to Jonathan Griffin (:jgriffin) from comment #4)
> Looks good, and tests pass!  Let's land it and then we can update the chrome
> code in a separate patch.

Let's do it in a separate bug. I'm not a big fan of lingering half-landed bugs. Filed bug 755036.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Summary: Save globals between execute_script calls → Save globals between execute_script calls in the 'content' context
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: