diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs index 144cf03a4be..e6eeb35cd2c 100644 --- a/components/script/dom/bluetooth.rs +++ b/components/script/dom/bluetooth.rs @@ -9,7 +9,7 @@ use bluetooth_traits::scanfilter::{RequestDeviceoptions, ServiceUUIDSequence}; use core::clone::Clone; use dom::bindings::codegen::Bindings::BluetoothBinding::{self, BluetoothMethods, BluetoothRequestDeviceFilter}; use dom::bindings::codegen::Bindings::BluetoothBinding::RequestDeviceOptions; -use dom::bindings::error::Error::{self, Security, Type}; +use dom::bindings::error::Error::{self, NotFound, Security, Type}; use dom::bindings::error::Fallible; use dom::bindings::js::Root; use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object}; @@ -25,7 +25,6 @@ use std::rc::Rc; const FILTER_EMPTY_ERROR: &'static str = "'filters' member, if present, must be nonempty to find any devices."; const FILTER_ERROR: &'static str = "A filter must restrict the devices in some way."; -const FILTER_NAME_TOO_LONG_ERROR: &'static str = "A 'name' or 'namePrefix' can't be longer then 29 bytes."; // 248 is the maximum number of UTF-8 code units in a Bluetooth Device Name. const MAX_DEVICE_NAME_LENGTH: usize = 248; // A device name can never be longer than 29 bytes. @@ -213,7 +212,7 @@ fn canonicalize_filter(filter: &BluetoothRequestDeviceFilter) -> Fallible MAX_FILTER_NAME_LENGTH { - return Err(Type(FILTER_NAME_TOO_LONG_ERROR.to_owned())); + return Err(NotFound); } // Step 2.4.4.2. @@ -233,7 +232,7 @@ fn canonicalize_filter(filter: &BluetoothRequestDeviceFilter) -> Fallible MAX_FILTER_NAME_LENGTH { - return Err(Type(FILTER_NAME_TOO_LONG_ERROR.to_owned())); + return Err(NotFound); } // Step 2.4.5.2. diff --git a/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-name.html.ini b/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-name.html.ini deleted file mode 100644 index fef1f01d99d..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-name.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[max-length-for-name-in-adv-name.html] - type: testharness - [A device name longer than 29 must reject.] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.html.ini b/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.html.ini deleted file mode 100644 index 1edd39d02f3..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/max-length-for-name-in-adv-namePrefix.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[max-length-for-name-in-adv-namePrefix.html] - type: testharness - [A device name prefix longer than 29 must reject.] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-name.html.ini b/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-name.html.ini deleted file mode 100644 index 983a50d4896..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-name.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[unicode-max-length-for-name-in-adv-name.html] - type: testharness - [Unicode string with utf8 representation between (29, 248\] bytes in 'name' must throw NotFoundError.] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-namePrefix.html.ini b/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-namePrefix.html.ini deleted file mode 100644 index b940588a8cd..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/bluetooth/requestDevice/canonicalizeFilter/unicode-max-length-for-name-in-adv-namePrefix.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[unicode-max-length-for-name-in-adv-namePrefix.html] - type: testharness - [Unicode string with utf8 representation between (29, 248\] bytes in 'namePrefix' must throw NotFoundError.] - expected: FAIL