Closed Bug 1122609 Opened 10 years ago Closed 10 years ago

execute_script() called with new_sandbox=False in chrome context does not use current script_args but those from a former call

Categories

(Testing :: Marionette Client and Harness, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla38

People

(Reporter: whimboo, Assigned: chmanchester)

References

Details

(Keywords: pi-marionette-client, pi-marionette-server)

Attachments

(2 files, 1 obsolete file)

When you call execute_script with new_sandbox=False it will operate on a wrong list of arguments:

        retval = self.marionette.execute_script("""
          return arguments[0];
        """, script_args=['test1'])
        self.assertEqual(retval, "test1")  # pass

        retval = self.marionette.execute_script("""
          return arguments[0];
        """, script_args=["test2"])
        self.assertEqual(retval, "test2")  # pass

        retval = self.marionette.execute_script("""
          return arguments[0];
        """, script_args=["test3"], new_sandbox=False)
        self.assertEqual(retval, "test3")  # fail

Here the 3rd block fails because arguments in the sandbox is equal to the one from the 2nd block. Looks like we even try to re-use the arguments instead of pushing in the new ones.
Arguments are set as a property of the sandbox at the time of sandbox creation in chrome scope, not so for content.
Assignee: nobody → cmanchester
Summary: execute_script() called with new_sandbox=False does not use current script_args but those from a former call → execute_script() called with new_sandbox=False in chrome context does not use current script_args but those from a former call
/r/2687 - Bug 1122609 - Test that setting script_args for multiple execute_script calls in chrome scope works when the sanbox is reused.
/r/2689 - Bug 1122609 - Set marionette arguments per execute script call in chrome scope even if the sanbox is reused.

Pull down these commits:

hg pull review -r 75859fa90d7f32359f17c807cd2cda00555596a3
Attachment #8551440 - Flags: review?(jgriffin) → review+
https://hg.mozilla.org/mozilla-central/rev/8f41739aee27
https://hg.mozilla.org/mozilla-central/rev/ffa9eece8287
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Blocks: 1120364
Attachment #8551440 - Attachment is obsolete: true
Attachment #8619168 - Flags: review+
Attachment #8619169 - Flags: review+
Product: Testing → Remote Protocol

Moving bugs for Marionette client due to component changes.

Component: Marionette → Marionette Client and Harness
Product: Remote Protocol → Testing
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: