author | Sebastian Hengst <archaeopteryx@coole-files.de> |
Thu, 08 Jun 2017 20:06:53 +0200 | |
changeset 411168 | 00c3f75ed9a00df54df729135cbd12651cd736b8 |
parent 411167 | 6b37ea6c7ad1c016c3fdb7ff1d1484c5be5bc938 |
child 411169 | 7459489e961dfa2aa2efc2a23802a91d671dfc44 |
push id | 7391 |
push user | mtabara@mozilla.com |
push date | Mon, 12 Jun 2017 13:08:53 +0000 |
treeherder | mozilla-beta@2191d7f87e2e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | backout |
bugs | 1370850 |
milestone | 55.0a1 |
backs out | eaef7cd5e2884314fb81c70d1b9576772a38e415 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/testing/marionette/driver.js +++ b/testing/marionette/driver.js @@ -866,36 +866,34 @@ GeckoDriver.prototype.executeAsyncScript resp.body.value = yield this.execute_(script, args, scriptTimeout, opts); }; GeckoDriver.prototype.execute_ = function (script, args, timeout, opts = {}) { switch (this.context) { case Context.CONTENT: // evaluate in content with lasting side-effects if (!opts.sandboxName) { - return this.listener.execute(script, args, timeout, opts) - .then(evaluate.toJSON); + return this.listener.execute(script, args, timeout, opts); // evaluate in content with sandbox } else { - return this.listener.executeInSandbox(script, args, timeout, opts) - .then(evaluate.toJSON); + return this.listener.executeInSandbox(script, args, timeout, opts); } case Context.CHROME: let sb = this.sandboxes.get(opts.sandboxName, opts.newSandbox); if (opts.sandboxName) { sb = sandbox.augment(sb, new logging.Adapter(this.marionetteLog)); sb = sandbox.augment(sb, {global: sb}); } opts.timeout = timeout; let wargs = evaluate.fromJSON(args, this.curBrowser.seenEls, sb.window); - return evaluate.sandbox(sb, script, wargs, opts) - .then(res => evaluate.toJSON(res, this.curBrowser.seenEls)); + let evaluatePromise = evaluate.sandbox(sb, script, wargs, opts); + return evaluatePromise.then(res => evaluate.toJSON(res, this.curBrowser.seenEls)); } }; /** * Navigate to given URL. * * Navigates the current browsing context to the given URL and waits for * the document to load or the session's page timeout duration to elapse
--- a/testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py +++ b/testing/marionette/harness/marionette_harness/tests/unit/test_execute_script.py @@ -1,17 +1,17 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import urllib from marionette_driver import By, errors -from marionette_driver.marionette import Alert, HTMLElement +from marionette_driver.marionette import HTMLElement from marionette_driver.wait import Wait from marionette_harness import MarionetteTestCase, skip_if_mobile, WindowManagerMixin def inline(doc): return "data:text/html;charset=utf-8,{}".format(urllib.quote(doc)) @@ -26,33 +26,16 @@ globals = set([ "navigator", "URL", "window", ]) class TestExecuteContent(MarionetteTestCase): - def alert_present(self): - try: - Alert(self.marionette).text - return True - except errors.NoAlertPresentException: - return False - - def wait_for_alert_closed(self, timeout=None): - Wait(self.marionette, timeout=timeout).until( - lambda _: not self.alert_present()) - - def tearDown(self): - if self.alert_present(): - alert = self.marionette.switch_to_alert() - alert.dismiss() - self.wait_for_alert_closed() - def assert_is_defined(self, property, sandbox="default"): self.assertTrue(self.marionette.execute_script( "return typeof arguments[0] != 'undefined'", [property], sandbox=sandbox), "property {} is undefined".format(property)) def assert_is_web_element(self, element): self.assertIsInstance(element, HTMLElement) @@ -352,21 +335,16 @@ class TestExecuteContent(MarionetteTestC return { toJSON () { return document.documentElement; } }""", sandbox=None) self.assert_is_web_element(el) - def test_return_value_on_alert(self): - res = self.marionette._send_message("executeScript", {"script": "alert()"}) - self.assertIn("value", res) - self.assertIsNone(res) - class TestExecuteChrome(WindowManagerMixin, TestExecuteContent): def setUp(self): super(TestExecuteChrome, self).setUp() self.marionette.set_context("chrome") @@ -425,19 +403,16 @@ class TestExecuteChrome(WindowManagerMix pass def test_system_sandbox_wrappedjsobject(self): pass def test_access_chrome_objects_in_event_listeners(self): pass - def test_return_value_on_alert(self): - pass - class TestElementCollections(MarionetteTestCase): def assertSequenceIsInstance(self, seq, typ): for item in seq: self.assertIsInstance(item, typ) def test_array(self):