Backed out changeset c7eea3e8f98a (bug 1154691) for Windows w-p-t failures.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2015-04-17 17:55:08 -04:00
parent ffce4d12ee
commit 95ac0282a4
4 changed files with 51 additions and 66 deletions

View File

@ -11,11 +11,11 @@ import time
import types import types
import weakref import weakref
from b2ginstance import B2GInstance
from marionette_driver.errors import InvalidResponseException
from marionette_driver.marionette import Marionette from marionette_driver.marionette import Marionette
from marionette_test import MarionetteTestCase from marionette_test import MarionetteTestCase
from marionette_transport import MarionetteTransport from marionette_transport import MarionetteTransport
from b2ginstance import B2GInstance
from runtests import MarionetteTestRunner, cli from runtests import MarionetteTestRunner, cli
class B2GUpdateMarionetteClient(MarionetteTransport): class B2GUpdateMarionetteClient(MarionetteTransport):
@ -237,10 +237,16 @@ class B2GUpdateTestCase(MarionetteTestCase):
self.print_status(status, os.path.basename(path)) self.print_status(status, os.path.basename(path))
results = self.marionette.execute_async_script(data, try:
script_args=[self.testvars], results = self.marionette.execute_async_script(data,
special_powers=True) script_args=[self.testvars],
self.handle_results(path, stage, results) special_powers=True)
self.handle_results(path, stage, results)
except InvalidResponseException, e:
# If the update test causes a restart, we will get an invalid
# response from the socket here.
if not will_restart:
raise e
def handle_results(self, path, stage, results): def handle_results(self, path, stage, results):
passed = results['passed'] passed = results['passed']

View File

@ -16,8 +16,8 @@ import warnings
from marionette_driver.errors import ( from marionette_driver.errors import (
MarionetteException, TimeoutException, MarionetteException, InstallGeckoError, TimeoutException, InvalidResponseException,
JavascriptException, NoSuchElementException, NoSuchWindowException, JavascriptException, NoSuchElementException, XPathLookupException, NoSuchWindowException,
StaleElementException, ScriptTimeoutException, ElementNotVisibleException, StaleElementException, ScriptTimeoutException, ElementNotVisibleException,
NoSuchFrameException, InvalidElementStateException, NoAlertPresentException, NoSuchFrameException, InvalidElementStateException, NoAlertPresentException,
InvalidCookieDomainException, UnableToSetCookieException, InvalidSelectorException, InvalidCookieDomainException, UnableToSetCookieException, InvalidSelectorException,

View File

@ -49,16 +49,8 @@ class MarionetteException(Exception):
return "".join(traceback.format_exception(self.__class__, msg, tb)) return "".join(traceback.format_exception(self.__class__, msg, tb))
class ElementNotSelectableException(MarionetteException): class InstallGeckoError(MarionetteException):
status = "element not selectable" pass
class InvalidArgumentException(MarionetteException):
status = "invalid argument"
class InvalidSessionIdException(MarionetteException):
status = "invalid session id"
class TimeoutException(MarionetteException): class TimeoutException(MarionetteException):
@ -66,6 +58,11 @@ class TimeoutException(MarionetteException):
status = "timeout" status = "timeout"
class InvalidResponseException(MarionetteException):
code = (53,)
status = "invalid response"
class JavascriptException(MarionetteException): class JavascriptException(MarionetteException):
code = (17,) code = (17,)
status = "javascript error" status = "javascript error"
@ -76,6 +73,11 @@ class NoSuchElementException(MarionetteException):
status = "no such element" status = "no such element"
class XPathLookupException(MarionetteException):
code = (19,)
status = "invalid xpath selector"
class NoSuchWindowException(MarionetteException): class NoSuchWindowException(MarionetteException):
code = (23,) code = (23,)
status = "no such window" status = "no such window"
@ -157,6 +159,11 @@ class FrameSendFailureError(MarionetteException):
status = "frame send failure" status = "frame send failure"
class UnsupportedOperationException(MarionetteException):
code = (405,)
status = "unsupported operation"
class SessionNotCreatedException(MarionetteException): class SessionNotCreatedException(MarionetteException):
code = (33, 71) code = (33, 71)
status = "session not created" status = "session not created"
@ -166,50 +173,31 @@ class UnexpectedAlertOpen(MarionetteException):
code = (26,) code = (26,)
status = "unexpected alert open" status = "unexpected alert open"
class UnknownCommandException(MarionetteException):
code = (9,)
status = "unknown command"
class UnknownException(MarionetteException):
code = (13,)
status = "unknown error"
class UnsupportedOperationException(MarionetteException):
code = (405,)
status = "unsupported operation"
excs = [ excs = [
ElementNotAccessibleException,
ElementNotSelectableException,
ElementNotVisibleException,
FrameSendFailureError,
FrameSendNotInitializedError,
InvalidArgumentException,
InvalidCookieDomainException,
InvalidElementCoordinates,
InvalidElementStateException,
InvalidSelectorException,
InvalidSessionIdException,
JavascriptException,
MarionetteException, MarionetteException,
MoveTargetOutOfBoundsException,
NoAlertPresentException,
NoSuchElementException,
NoSuchFrameException,
NoSuchWindowException,
ScriptTimeoutException,
SessionNotCreatedException,
StaleElementException,
TimeoutException, TimeoutException,
InvalidResponseException,
JavascriptException,
NoSuchElementException,
XPathLookupException,
NoSuchWindowException,
StaleElementException,
ScriptTimeoutException,
ElementNotVisibleException,
ElementNotAccessibleException,
NoSuchFrameException,
InvalidElementStateException,
NoAlertPresentException,
InvalidCookieDomainException,
UnableToSetCookieException, UnableToSetCookieException,
UnexpectedAlertOpen, InvalidElementCoordinates,
UnknownCommandException, InvalidSelectorException,
UnknownException, MoveTargetOutOfBoundsException,
FrameSendNotInitializedError,
FrameSendFailureError,
UnsupportedOperationException, UnsupportedOperationException,
SessionNotCreatedException,
UnexpectedAlertOpen,
] ]

View File

@ -14,7 +14,6 @@ const errors = [
"IllegalArgumentError", "IllegalArgumentError",
"InvalidElementStateError", "InvalidElementStateError",
"InvalidSelectorError", "InvalidSelectorError",
"InvalidSessionIdError",
"JavaScriptError", "JavaScriptError",
"NoAlertOpenError", "NoAlertOpenError",
"NoSuchElementError", "NoSuchElementError",
@ -212,14 +211,6 @@ this.InvalidSelectorError = function(msg) {
}; };
InvalidSelectorError.prototype = Object.create(WebDriverError.prototype); InvalidSelectorError.prototype = Object.create(WebDriverError.prototype);
this.InvalidSessionIdError = function(msg) {
WebDriverError.call(this, msg);
this.name = "InvalidSessionIdError";
this.status = "invalid session id";
this.code = 13;
};
InvalidSessionIdError.prototype = Object.create(WebDriverError.prototype);
/** /**
* Creates an error message for a JavaScript error thrown during * Creates an error message for a JavaScript error thrown during
* executeScript or executeAsyncScript. * executeScript or executeAsyncScript.