Auto merge of #22480 - cdeler:implement-DOMException-constructor, r=jdm

Implement dom exception constructor

The constructor method was implemented

I have a question: should I edit `./mach test-wpt` expectations?

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #22412
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22480)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-03-20 16:13:17 -04:00 committed by GitHub
commit 6d308c3577
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
158 changed files with 553 additions and 522 deletions

View file

@ -5,6 +5,7 @@
use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding; use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding;
use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionConstants; use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionConstants;
use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods; use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods;
use crate::dom::bindings::error::Error;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector}; use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot; use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString; use crate::dom::bindings::str::DOMString;
@ -38,43 +39,46 @@ pub enum DOMErrorName {
NotReadableError = DOMExceptionConstants::NOT_READABLE_ERR, NotReadableError = DOMExceptionConstants::NOT_READABLE_ERR,
} }
impl DOMErrorName {
pub fn from(s: &DOMString) -> Option<DOMErrorName> {
match s.as_ref() {
"IndexSizeError" => Some(DOMErrorName::IndexSizeError),
"HierarchyRequestError" => Some(DOMErrorName::HierarchyRequestError),
"WrongDocumentError" => Some(DOMErrorName::WrongDocumentError),
"InvalidCharacterError" => Some(DOMErrorName::InvalidCharacterError),
"NoModificationAllowedError" => Some(DOMErrorName::NoModificationAllowedError),
"NotFoundError" => Some(DOMErrorName::NotFoundError),
"NotSupportedError" => Some(DOMErrorName::NotSupportedError),
"InUseAttributeError" => Some(DOMErrorName::InUseAttributeError),
"InvalidStateError" => Some(DOMErrorName::InvalidStateError),
"SyntaxError" => Some(DOMErrorName::SyntaxError),
"InvalidModificationError" => Some(DOMErrorName::InvalidModificationError),
"NamespaceError" => Some(DOMErrorName::NamespaceError),
"InvalidAccessError" => Some(DOMErrorName::InvalidAccessError),
"SecurityError" => Some(DOMErrorName::SecurityError),
"NetworkError" => Some(DOMErrorName::NetworkError),
"AbortError" => Some(DOMErrorName::AbortError),
"TypeMismatchError" => Some(DOMErrorName::TypeMismatchError),
"QuotaExceededError" => Some(DOMErrorName::QuotaExceededError),
"TimeoutError" => Some(DOMErrorName::TimeoutError),
"InvalidNodeTypeError" => Some(DOMErrorName::InvalidNodeTypeError),
"DataCloneError" => Some(DOMErrorName::DataCloneError),
"NotReadableError" => Some(DOMErrorName::NotReadableError),
_ => None,
}
}
}
#[dom_struct] #[dom_struct]
pub struct DOMException { pub struct DOMException {
reflector_: Reflector, reflector_: Reflector,
code: DOMErrorName, message: DOMString,
name: DOMString,
} }
impl DOMException { impl DOMException {
fn new_inherited(code: DOMErrorName) -> DOMException { fn get_error_data_by_code(code: DOMErrorName) -> (DOMString, DOMString) {
DOMException { let message = match &code {
reflector_: Reflector::new(),
code: code,
}
}
pub fn new(global: &GlobalScope, code: DOMErrorName) -> DomRoot<DOMException> {
reflect_dom_object(
Box::new(DOMException::new_inherited(code)),
global,
DOMExceptionBinding::Wrap,
)
}
}
impl DOMExceptionMethods for DOMException {
// https://heycam.github.io/webidl/#dfn-DOMException
fn Code(&self) -> u16 {
self.code as u16
}
// https://heycam.github.io/webidl/#idl-DOMException-error-names
fn Name(&self) -> DOMString {
DOMString::from(format!("{:?}", self.code))
}
// https://heycam.github.io/webidl/#error-names
fn Message(&self) -> DOMString {
let message = match self.code {
DOMErrorName::IndexSizeError => "The index is not in the allowed range.", DOMErrorName::IndexSizeError => "The index is not in the allowed range.",
DOMErrorName::HierarchyRequestError => { DOMErrorName::HierarchyRequestError => {
"The operation would yield an incorrect node tree." "The operation would yield an incorrect node tree."
@ -105,11 +109,64 @@ impl DOMExceptionMethods for DOMException {
DOMErrorName::NotReadableError => "The I/O read operation failed.", DOMErrorName::NotReadableError => "The I/O read operation failed.",
}; };
DOMString::from(message) (
DOMString::from(message),
DOMString::from(format!("{:?}", code)),
)
}
fn new_inherited(message_: DOMString, name_: DOMString) -> DOMException {
DOMException {
reflector_: Reflector::new(),
message: message_,
name: name_,
}
}
pub fn new(global: &GlobalScope, code: DOMErrorName) -> DomRoot<DOMException> {
let (message, name) = DOMException::get_error_data_by_code(code);
reflect_dom_object(
Box::new(DOMException::new_inherited(message, name)),
global,
DOMExceptionBinding::Wrap,
)
}
pub fn Constructor(
global: &GlobalScope,
message: DOMString,
name: DOMString,
) -> Result<DomRoot<DOMException>, Error> {
Ok(reflect_dom_object(
Box::new(DOMException::new_inherited(message, name)),
global,
DOMExceptionBinding::Wrap,
))
}
}
impl DOMExceptionMethods for DOMException {
// https://heycam.github.io/webidl/#dfn-DOMException
fn Code(&self) -> u16 {
match DOMErrorName::from(&self.name) {
Some(code) => code as u16,
None => 0 as u16,
}
}
// https://heycam.github.io/webidl/#idl-DOMException-error-names
fn Name(&self) -> DOMString {
self.name.clone()
}
// https://heycam.github.io/webidl/#error-names
fn Message(&self) -> DOMString {
self.message.clone()
} }
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-error.prototype.tostring // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-error.prototype.tostring
fn Stringifier(&self) -> DOMString { fn Stringifier(&self) -> DOMString {
DOMString::from(format!("{}: {}", self.Name(), self.Message())) DOMString::from(format!("{}: {}", self.name, self.message))
} }
} }

View file

@ -7,7 +7,11 @@
* https://heycam.github.io/webidl/#es-DOMException-constructor-object * https://heycam.github.io/webidl/#es-DOMException-constructor-object
*/ */
[ExceptionClass, Exposed=(Window,Worker)] [
ExceptionClass,
Exposed=(Window,Worker),
Constructor(optional DOMString message="", optional DOMString name="Error")
]
interface DOMException { interface DOMException {
const unsigned short INDEX_SIZE_ERR = 1; const unsigned short INDEX_SIZE_ERR = 1;
const unsigned short DOMSTRING_SIZE_ERR = 2; // historical const unsigned short DOMSTRING_SIZE_ERR = 2; // historical

View file

@ -1,197 +1,11 @@
[DOMException-constructor-behavior.any.worker.html] [DOMException-constructor-behavior.any.worker.html]
type: testharness type: testharness
[new DOMException()]
expected: FAIL
[new DOMException(): inherited-ness]
expected: FAIL
[new DOMException(null)]
expected: FAIL
[new DOMException(undefined)]
expected: FAIL
[new DOMException(undefined): inherited-ness]
expected: FAIL
[new DOMException("foo")]
expected: FAIL
[new DOMException("foo"): inherited-ness]
expected: FAIL
[new DOMException("bar", undefined)]
expected: FAIL
[new DOMException("bar", "NotSupportedError")]
expected: FAIL
[new DOMException("bar", "NotSupportedError"): inherited-ness]
expected: FAIL
[new DOMException("bar", "foo")]
expected: FAIL
[new DOMexception("msg", "IndexSizeError")]
expected: FAIL
[new DOMexception("msg", "HierarchyRequestError")]
expected: FAIL
[new DOMexception("msg", "WrongDocumentError")]
expected: FAIL
[new DOMexception("msg", "InvalidCharacterError")]
expected: FAIL
[new DOMexception("msg", "NoModificationAllowedError")]
expected: FAIL
[new DOMexception("msg", "NotFoundError")]
expected: FAIL
[new DOMexception("msg", "NotSupportedError")]
expected: FAIL
[new DOMexception("msg", "InUseAttributeError")]
expected: FAIL
[new DOMexception("msg", "InvalidStateError")]
expected: FAIL
[new DOMexception("msg", "SyntaxError")]
expected: FAIL
[new DOMexception("msg", "InvalidModificationError")]
expected: FAIL
[new DOMexception("msg", "NamespaceError")]
expected: FAIL
[new DOMexception("msg", "InvalidAccessError")]
expected: FAIL
[new DOMexception("msg", "SecurityError")]
expected: FAIL
[new DOMexception("msg", "NetworkError")]
expected: FAIL
[new DOMexception("msg", "AbortError")]
expected: FAIL
[new DOMexception("msg", "URLMismatchError")] [new DOMexception("msg", "URLMismatchError")]
expected: FAIL expected: FAIL
[new DOMexception("msg", "QuotaExceededError")]
expected: FAIL
[new DOMexception("msg", "TimeoutError")]
expected: FAIL
[new DOMexception("msg", "InvalidNodeTypeError")]
expected: FAIL
[new DOMexception("msg", "DataCloneError")]
expected: FAIL
[DOMException-constructor-behavior.any.html] [DOMException-constructor-behavior.any.html]
type: testharness type: testharness
[new DOMException()]
expected: FAIL
[new DOMException(): inherited-ness]
expected: FAIL
[new DOMException(null)]
expected: FAIL
[new DOMException(undefined)]
expected: FAIL
[new DOMException(undefined): inherited-ness]
expected: FAIL
[new DOMException("foo")]
expected: FAIL
[new DOMException("foo"): inherited-ness]
expected: FAIL
[new DOMException("bar", undefined)]
expected: FAIL
[new DOMException("bar", "NotSupportedError")]
expected: FAIL
[new DOMException("bar", "NotSupportedError"): inherited-ness]
expected: FAIL
[new DOMException("bar", "foo")]
expected: FAIL
[new DOMexception("msg", "IndexSizeError")]
expected: FAIL
[new DOMexception("msg", "HierarchyRequestError")]
expected: FAIL
[new DOMexception("msg", "WrongDocumentError")]
expected: FAIL
[new DOMexception("msg", "InvalidCharacterError")]
expected: FAIL
[new DOMexception("msg", "NoModificationAllowedError")]
expected: FAIL
[new DOMexception("msg", "NotFoundError")]
expected: FAIL
[new DOMexception("msg", "NotSupportedError")]
expected: FAIL
[new DOMexception("msg", "InUseAttributeError")]
expected: FAIL
[new DOMexception("msg", "InvalidStateError")]
expected: FAIL
[new DOMexception("msg", "SyntaxError")]
expected: FAIL
[new DOMexception("msg", "InvalidModificationError")]
expected: FAIL
[new DOMexception("msg", "NamespaceError")]
expected: FAIL
[new DOMexception("msg", "InvalidAccessError")]
expected: FAIL
[new DOMexception("msg", "SecurityError")]
expected: FAIL
[new DOMexception("msg", "NetworkError")]
expected: FAIL
[new DOMexception("msg", "AbortError")]
expected: FAIL
[new DOMexception("msg", "URLMismatchError")] [new DOMexception("msg", "URLMismatchError")]
expected: FAIL expected: FAIL
[new DOMexception("msg", "QuotaExceededError")]
expected: FAIL
[new DOMexception("msg", "TimeoutError")]
expected: FAIL
[new DOMexception("msg", "InvalidNodeTypeError")]
expected: FAIL
[new DOMexception("msg", "DataCloneError")]
expected: FAIL

View file

@ -1,20 +1,5 @@
[DOMException-custom-bindings.any.worker.html] [DOMException-custom-bindings.any.worker.html]
type: testharness type: testharness
[message property descriptor]
expected: FAIL
[name property descriptor]
expected: FAIL
[code property descriptor]
expected: FAIL
[code property is not affected by shadowing the name property]
expected: FAIL
[Object.prototype.toString behavior is like other interfaces]
expected: FAIL
[Inherits its toString() from Error.prototype] [Inherits its toString() from Error.prototype]
expected: FAIL expected: FAIL
@ -24,21 +9,6 @@
[DOMException-custom-bindings.any.html] [DOMException-custom-bindings.any.html]
type: testharness type: testharness
[message property descriptor]
expected: FAIL
[name property descriptor]
expected: FAIL
[code property descriptor]
expected: FAIL
[code property is not affected by shadowing the name property]
expected: FAIL
[Object.prototype.toString behavior is like other interfaces]
expected: FAIL
[Inherits its toString() from Error.prototype] [Inherits its toString() from Error.prototype]
expected: FAIL expected: FAIL

View file

@ -1,275 +1,3 @@
[interfaces.html] [interfaces.html]
type: testharness type: testharness
[DOMException must be primary interface of new DOMException()]
expected: FAIL
[Stringification of new DOMException()]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "name" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "message" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "code" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "INDEX_SIZE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "DOMSTRING_SIZE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "HIERARCHY_REQUEST_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "WRONG_DOCUMENT_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "INVALID_CHARACTER_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "NO_DATA_ALLOWED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "NO_MODIFICATION_ALLOWED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "NOT_FOUND_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "NOT_SUPPORTED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "INUSE_ATTRIBUTE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "INVALID_STATE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "SYNTAX_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "INVALID_MODIFICATION_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "NAMESPACE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "INVALID_ACCESS_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "VALIDATION_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "TYPE_MISMATCH_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "SECURITY_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "NETWORK_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "ABORT_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "URL_MISMATCH_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "QUOTA_EXCEEDED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "TIMEOUT_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "INVALID_NODE_TYPE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException() must inherit property "DATA_CLONE_ERR" with the proper type]
expected: FAIL
[DOMException must be primary interface of new DOMException("my message")]
expected: FAIL
[Stringification of new DOMException("my message")]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "name" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "message" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "code" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "INDEX_SIZE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "DOMSTRING_SIZE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "HIERARCHY_REQUEST_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "WRONG_DOCUMENT_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "INVALID_CHARACTER_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "NO_DATA_ALLOWED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "NO_MODIFICATION_ALLOWED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "NOT_FOUND_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "NOT_SUPPORTED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "INUSE_ATTRIBUTE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "INVALID_STATE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "SYNTAX_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "INVALID_MODIFICATION_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "NAMESPACE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "INVALID_ACCESS_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "VALIDATION_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "TYPE_MISMATCH_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "SECURITY_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "NETWORK_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "ABORT_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "URL_MISMATCH_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "QUOTA_EXCEEDED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "TIMEOUT_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "INVALID_NODE_TYPE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message") must inherit property "DATA_CLONE_ERR" with the proper type]
expected: FAIL
[DOMException must be primary interface of new DOMException("my message", "myName")]
expected: FAIL
[Stringification of new DOMException("my message", "myName")]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "name" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "message" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "code" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "INDEX_SIZE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "DOMSTRING_SIZE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "HIERARCHY_REQUEST_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "WRONG_DOCUMENT_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "INVALID_CHARACTER_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "NO_DATA_ALLOWED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "NO_MODIFICATION_ALLOWED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "NOT_FOUND_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "NOT_SUPPORTED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "INUSE_ATTRIBUTE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "INVALID_STATE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "SYNTAX_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "INVALID_MODIFICATION_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "NAMESPACE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "INVALID_ACCESS_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "VALIDATION_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "TYPE_MISMATCH_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "SECURITY_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "NETWORK_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "ABORT_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "URL_MISMATCH_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "QUOTA_EXCEEDED_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "TIMEOUT_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "INVALID_NODE_TYPE_ERR" with the proper type]
expected: FAIL
[DOMException interface: new DOMException("my message", "myName") must inherit property "DATA_CLONE_ERR" with the proper type]
expected: FAIL
[WebIDL IDL tests]
expected: FAIL

View file

@ -2,3 +2,6 @@
[characteristicProperties] [characteristicProperties]
expected: FAIL expected: FAIL
[HeartRate device properties]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-characteristic-is-removed] [gen-characteristic-is-removed]
expected: FAIL expected: FAIL
[Characteristic gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-descriptor-get-same-object] [gen-descriptor-get-same-object]
expected: FAIL expected: FAIL
[Calls to getDescriptor should return the same object.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-service-is-removed] [gen-service-is-removed]
expected: FAIL expected: FAIL
[Service is removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-characteristic-is-removed-with-uuid] [gen-characteristic-is-removed-with-uuid]
expected: FAIL expected: FAIL
[Characteristic gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-characteristic-is-removed] [gen-characteristic-is-removed]
expected: FAIL expected: FAIL
[Characteristic gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-descriptor-get-same-object] [gen-descriptor-get-same-object]
expected: FAIL expected: FAIL
[Calls to getDescriptors should return the same object.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-service-is-removed-with-uuid] [gen-service-is-removed-with-uuid]
expected: FAIL expected: FAIL
[Service is removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-service-is-removed] [gen-service-is-removed]
expected: FAIL expected: FAIL
[Service is removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[characteristic-is-removed] [characteristic-is-removed]
expected: FAIL expected: FAIL
[Characteristic is removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[service-is-removed] [service-is-removed]
expected: FAIL expected: FAIL
[Service is removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[add-multiple-event-listeners] [add-multiple-event-listeners]
expected: FAIL expected: FAIL
[Add multiple event listeners then readValue().]
expected: FAIL

View file

@ -2,3 +2,6 @@
[characteristic-is-removed] [characteristic-is-removed]
expected: FAIL expected: FAIL
[Characteristic gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[event-is-fired] [event-is-fired]
expected: FAIL expected: FAIL
[Reading a characteristic should fire an event.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-characteristic-is-removed] [gen-characteristic-is-removed]
expected: FAIL expected: FAIL
[Characteristic gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[read-succeeds] [read-succeeds]
expected: FAIL expected: FAIL
[A read request succeeds and returns the characteristic's value.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[read-updates-value] [read-updates-value]
expected: FAIL expected: FAIL
[Succesful read should update characteristic.value]
expected: FAIL

View file

@ -2,3 +2,6 @@
[service-is-removed] [service-is-removed]
expected: FAIL expected: FAIL
[Service gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[service-same-from-2-characteristics] [service-same-from-2-characteristics]
expected: FAIL expected: FAIL
[Same parent service returned from multiple characteristics.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[service-same-object] [service-same-object]
expected: FAIL expected: FAIL
[[SameObject\] test for BluetoothRemoteGATTCharacteristic service.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-characteristic-is-removed] [gen-characteristic-is-removed]
expected: FAIL expected: FAIL
[Characteristic gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[characteristic-is-removed] [characteristic-is-removed]
expected: FAIL expected: FAIL
[Characteristic gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-characteristic-is-removed] [gen-characteristic-is-removed]
expected: FAIL expected: FAIL
[Characteristic gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[service-is-removed] [service-is-removed]
expected: FAIL expected: FAIL
[Service gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[write-succeeds] [write-succeeds]
expected: FAIL expected: FAIL
[A regular write request to a writable characteristic should succeed.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-service-is-removed] [gen-service-is-removed]
expected: FAIL expected: FAIL
[Service gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[read-succeeds] [read-succeeds]
expected: FAIL expected: FAIL
[A read request succeeds and returns the descriptor's value.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-service-is-removed] [gen-service-is-removed]
expected: FAIL expected: FAIL
[Service gets removed. Reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[disconnected] [disconnected]
expected: FAIL expected: FAIL
[A device disconnecting while connected should fire the gattserverdisconnected event.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[disconnected_gc] [disconnected_gc]
expected: FAIL expected: FAIL
[A device disconnecting after the BluetoothDevice object has been GC'ed should not access freed memory.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[one-event-per-disconnection] [one-event-per-disconnection]
expected: FAIL expected: FAIL
[If a site disconnects from a device while the platform is disconnecting that device, only one gattserverdisconnected event should fire.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[reconnect-during-disconnected-event] [reconnect-during-disconnected-event]
expected: FAIL expected: FAIL
[A device that reconnects during the gattserverdisconnected event should still receive gattserverdisconnected events after re-connection.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[idl-BluetoothDevice] [idl-BluetoothDevice]
expected: FAIL expected: FAIL
[BluetoothDevice attributes.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[device-with-empty-name] [device-with-empty-name]
expected: FAIL expected: FAIL
[Device with empty name and no UUIDs nearby. Should be found if acceptAllDevices is true.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[device-with-name] [device-with-name]
expected: FAIL expected: FAIL
[A device with name and no UUIDs nearby. Should be found if acceptAllDevices is true.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[optional-services-missing] [optional-services-missing]
expected: FAIL expected: FAIL
[requestDevice called with acceptAllDevices: true and with no optionalServices. Should not get access to any services.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[optional-services-present] [optional-services-present]
expected: FAIL expected: FAIL
[requestDevice called with acceptAllDevices: true and with optionalServices. Should get access to services.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[blocklisted-service-in-filter] [blocklisted-service-in-filter]
expected: FAIL expected: FAIL
[Reject with SecurityError if requesting a blocklisted service.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[blocklisted-service-in-optionalServices] [blocklisted-service-in-optionalServices]
expected: FAIL expected: FAIL
[Blocklisted UUID in optionalServices is removed and access not granted.]
expected: FAIL

View file

@ -0,0 +1,2 @@
prefs: ["dom.bluetooth.enabled:true"]
disabled: "#23066"

View file

@ -2,3 +2,6 @@
[device-name-longer-than-29-bytes] [device-name-longer-than-29-bytes]
expected: FAIL expected: FAIL
[A device name between 29 and 248 bytes is valid.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[empty-filter] [empty-filter]
expected: FAIL expected: FAIL
[A filter must restrict the devices in some way.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[empty-filters-member] [empty-filters-member]
expected: FAIL expected: FAIL
[An empty |filters| member should result in a TypeError]
expected: FAIL

View file

@ -2,3 +2,6 @@
[empty-namePrefix] [empty-namePrefix]
expected: FAIL expected: FAIL
[requestDevice with empty namePrefix. Should reject with TypeError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[empty-services-member] [empty-services-member]
expected: FAIL expected: FAIL
[Services member must contain at least one service.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[filters-xor-acceptAllDevices] [filters-xor-acceptAllDevices]
expected: FAIL expected: FAIL
[RequestDeviceOptions should have exactly one of 'filters' or 'acceptAllDevices:true'. Reject with TypeError if not.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[max-length-exceeded-name-unicode] [max-length-exceeded-name-unicode]
expected: FAIL expected: FAIL
[Unicode string with utf8 representation longer than 248 bytes in 'name' must throw TypeError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[max-length-exceeded-name] [max-length-exceeded-name]
expected: FAIL expected: FAIL
[A device name longer than 248 must reject.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[max-length-exceeded-namePrefix-unicode] [max-length-exceeded-namePrefix-unicode]
expected: FAIL expected: FAIL
[Unicode string with utf8 representation longer than 248 bytes in 'namePrefix' must throw NotFoundError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[max-length-exceeded-namePrefix] [max-length-exceeded-namePrefix]
expected: FAIL expected: FAIL
[A device name prefix longer than 248 must reject.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[max-length-name-unicode] [max-length-name-unicode]
expected: FAIL expected: FAIL
[A unicode device name of 248 bytes is valid.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[max-length-name] [max-length-name]
expected: FAIL expected: FAIL
[A device name of 248 bytes is valid.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[max-length-namePrefix-unicode] [max-length-namePrefix-unicode]
expected: FAIL expected: FAIL
[A unicode device namePrefix of 248 bytes is valid.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[max-length-namePrefix] [max-length-namePrefix]
expected: FAIL expected: FAIL
[A device namePrefix of 248 bytes is valid.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[unicode-valid-length-name-name] [unicode-valid-length-name-name]
expected: FAIL expected: FAIL
[A name containing unicode characters whose utf8 length is less than 30 must not throw an error.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[unicode-valid-length-name-namePrefix] [unicode-valid-length-name-namePrefix]
expected: FAIL expected: FAIL
[A namePrefix containing unicode characters whose utf8 length is less than 30 must not throw an error.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[wrong-service-in-optionalServices-member] [wrong-service-in-optionalServices-member]
expected: FAIL expected: FAIL
[Invalid optional service must reject the promise.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[wrong-service-in-services-member] [wrong-service-in-services-member]
expected: FAIL expected: FAIL
[Invalid service must reject the promise.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[cross-origin-iframe] [cross-origin-iframe]
expected: FAIL expected: FAIL
[Request device from a unique origin. Should reject with SecurityError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[discovery-succeeds] [discovery-succeeds]
expected: FAIL expected: FAIL
[Discover a device using alias, name, or UUID.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[doesnt-consume-user-gesture] [doesnt-consume-user-gesture]
expected: FAIL expected: FAIL
[requestDevice calls do not consume user gestures.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[filter-matches] [filter-matches]
expected: FAIL expected: FAIL
[Matches a filter if all present members match.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[le-not-supported] [le-not-supported]
expected: FAIL expected: FAIL
[Reject with NotFoundError if Bluetooth is not supported.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[name-empty-device-from-name-empty-filter] [name-empty-device-from-name-empty-filter]
expected: FAIL expected: FAIL
[An empty name device can be obtained by empty name filter.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[not-processing-user-gesture] [not-processing-user-gesture]
expected: FAIL expected: FAIL
[Requires a user gesture.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[radio-not-present] [radio-not-present]
expected: FAIL expected: FAIL
[Reject with NotFoundError if there is no BT radio present.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[request-from-iframe] [request-from-iframe]
expected: FAIL expected: FAIL
[Concurrent requestDevice calls in iframes work.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[request-from-sandboxed-iframe] [request-from-sandboxed-iframe]
expected: FAIL expected: FAIL
[Request device from a unique origin. Should reject with SecurityError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[same-device] [same-device]
expected: FAIL expected: FAIL
[Returned device should always be the same.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[single-filter-single-service] [single-filter-single-service]
expected: FAIL expected: FAIL
[Simple filter selects matching device.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[connection-succeeds] [connection-succeeds]
expected: FAIL expected: FAIL
[Device will connect]
expected: FAIL

View file

@ -2,3 +2,6 @@
[garbage-collection-ran-during-success] [garbage-collection-ran-during-success]
expected: FAIL expected: FAIL
[Garbage Collection ran during a connect call that succeeds. Should not crash.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[get-same-gatt-server] [get-same-gatt-server]
expected: FAIL expected: FAIL
[Multiple connects should return the same gatt object.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[device-same-object] [device-same-object]
expected: FAIL expected: FAIL
[[SameObject\] test for BluetoothRemoteGATTServer's device.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[connect-disconnect-twice] [connect-disconnect-twice]
expected: FAIL expected: FAIL
[Connect + Disconnect twice still results in 'connected' being false.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[detach-gc] [detach-gc]
expected: FAIL expected: FAIL
[Detach frame then garbage collect. We shouldn't crash.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[disconnect-twice-in-a-row] [disconnect-twice-in-a-row]
expected: FAIL expected: FAIL
[Calling disconnect twice in a row still results in 'connected' being false.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gc-detach] [gc-detach]
expected: FAIL expected: FAIL
[Garbage collect then detach frame. We shouldn't crash.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-disconnect-called-before] [gen-disconnect-called-before]
expected: FAIL expected: FAIL
[disconnect() called before getPrimaryService. Reject with NetworkError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-disconnect-called-during-error] [gen-disconnect-called-during-error]
expected: FAIL expected: FAIL
[disconnect() called during a getPrimaryService call that fails. Reject with NetworkError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-disconnect-called-during-success] [gen-disconnect-called-during-success]
expected: FAIL expected: FAIL
[disconnect() called during a getPrimaryService call that succeeds. Reject with NetworkError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-disconnect-invalidates-objects] [gen-disconnect-invalidates-objects]
expected: FAIL expected: FAIL
[Calls on services after we disconnect and connect again. Should reject with InvalidStateError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-disconnected-device] [gen-disconnected-device]
expected: FAIL expected: FAIL
[getPrimaryService called before connecting. Reject with NetworkError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-discovery-complete-no-permission-absent-service] [gen-discovery-complete-no-permission-absent-service]
expected: FAIL expected: FAIL
[Request for absent service without permission. Should Reject with SecurityError even if services have been discovered already.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-discovery-complete-service-not-found] [gen-discovery-complete-service-not-found]
expected: FAIL expected: FAIL
[Request for absent service. Must reject with NotFoundError even when the services have previously been discovered.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-garbage-collection-ran-during-error] [gen-garbage-collection-ran-during-error]
expected: FAIL expected: FAIL
[Garbage Collection ran during a getPrimaryService call that failed. Should not crash.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-garbage-collection-ran-during-success] [gen-garbage-collection-ran-during-success]
expected: FAIL expected: FAIL
[Garbage Collection ran during a getPrimaryService call that succeeds. Should not crash.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-get-different-service-after-reconnection] [gen-get-different-service-after-reconnection]
expected: FAIL expected: FAIL
[Calls to getPrimaryService after a disconnection should return a different object.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-get-same-object] [gen-get-same-object]
expected: FAIL expected: FAIL
[Calls to getPrimaryService should return the same object.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-invalid-service-name] [gen-invalid-service-name]
expected: FAIL expected: FAIL
[Wrong Service name. Reject with TypeError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-no-permission-absent-service] [gen-no-permission-absent-service]
expected: FAIL expected: FAIL
[Request for absent service without permission. Reject with SecurityError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-no-permission-for-any-service] [gen-no-permission-for-any-service]
expected: FAIL expected: FAIL
[Request for present service without permission to access any service. Reject with SecurityError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-no-permission-present-service] [gen-no-permission-present-service]
expected: FAIL expected: FAIL
[Request for present service without permission. Reject with SecurityError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[gen-service-not-found] [gen-service-not-found]
expected: FAIL expected: FAIL
[Request for absent service. Reject with NotFoundError.]
expected: FAIL

View file

@ -2,3 +2,6 @@
[service-found] [service-found]
expected: FAIL expected: FAIL
[Request for service. Should return right service]
expected: FAIL

Some files were not shown because too many files have changed in this diff Show more