Add pref to ignore popup in testing

This commit is contained in:
Attila Dusnoki 2017-02-10 15:07:22 +01:00
parent 3ec9f0bab9
commit 4a62562b0f
4 changed files with 12 additions and 8 deletions

View file

@ -17,7 +17,7 @@ use dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::Bluetoot
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerBinding::
BluetoothRemoteGATTServerMethods;
use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::Bindings::PermissionStatusBinding::PermissionState;
use dom::bindings::codegen::Bindings::PermissionStatusBinding::{PermissionName, PermissionState};
use dom::bindings::codegen::UnionTypes::{StringOrStringSequence, StringOrUnsignedLong};
use dom::bindings::error::Error::{self, Network, Security, Type};
use dom::bindings::error::Fallible;
@ -216,11 +216,9 @@ impl Bluetooth {
ServiceUUIDSequence::new(optional_services_uuids));
// Step 3 - 5
// FIXME The following call will create a popup, which will mess up the testing...
// Maybe create a call to the lower level to check if we are testing or not
// if let PermissionState::Denied = get_descriptor_permission_state(PermissionName::Bluetooth, None) {
// return p.reject_error(p.global().get_cx(), Error::NotFound);
// }
if let PermissionState::Denied = get_descriptor_permission_state(PermissionName::Bluetooth, None) {
return p.reject_error(p.global().get_cx(), Error::NotFound);
}
// Note: Steps 6 - 8 are implemented in
// components/net/bluetooth_thread.rs in request_device function.