gecko/dom/mobileconnection/tests/marionette/test_call_barring_get_option.js
Edgar Chen 7576dae8e6 Bug 956655 - Part 1: Move MobileConnection related files to dom/mobileconnection. r=smaug,khuey
--HG--
rename : dom/network/interfaces/nsIDOMMobileConnection.idl => dom/mobileconnection/interfaces/nsIDOMMobileConnection.idl
rename : dom/network/interfaces/nsIMobileConnectionProvider.idl => dom/mobileconnection/interfaces/nsIMobileConnectionProvider.idl
rename : dom/network/tests/marionette/manifest.ini => dom/mobileconnection/tests/marionette/manifest.ini
rename : dom/network/tests/marionette/test_call_barring_change_password.js => dom/mobileconnection/tests/marionette/test_call_barring_change_password.js
rename : dom/network/tests/marionette/test_call_barring_get_option.js => dom/mobileconnection/tests/marionette/test_call_barring_get_option.js
rename : dom/network/tests/marionette/test_call_barring_set_error.js => dom/mobileconnection/tests/marionette/test_call_barring_set_error.js
rename : dom/network/tests/marionette/test_mobile_connections_array_uninitialized.js => dom/mobileconnection/tests/marionette/test_mobile_connections_array_uninitialized.js
rename : dom/network/tests/marionette/test_mobile_data_connection.js => dom/mobileconnection/tests/marionette/test_mobile_data_connection.js
rename : dom/network/tests/marionette/test_mobile_data_location.js => dom/mobileconnection/tests/marionette/test_mobile_data_location.js
rename : dom/network/tests/marionette/test_mobile_data_state.js => dom/mobileconnection/tests/marionette/test_mobile_data_state.js
rename : dom/network/tests/marionette/test_mobile_icc_change.js => dom/mobileconnection/tests/marionette/test_mobile_icc_change.js
rename : dom/network/tests/marionette/test_mobile_last_known_network.js => dom/mobileconnection/tests/marionette/test_mobile_last_known_network.js
rename : dom/network/tests/marionette/test_mobile_mmi.js => dom/mobileconnection/tests/marionette/test_mobile_mmi.js
rename : dom/network/tests/marionette/test_mobile_networks.js => dom/mobileconnection/tests/marionette/test_mobile_networks.js
rename : dom/network/tests/marionette/test_mobile_operator_names.js => dom/mobileconnection/tests/marionette/test_mobile_operator_names.js
rename : dom/network/tests/marionette/test_mobile_preferred_network_type.js => dom/mobileconnection/tests/marionette/test_mobile_preferred_network_type.js
rename : dom/network/tests/marionette/test_mobile_preferred_network_type_by_setting.js => dom/mobileconnection/tests/marionette/test_mobile_preferred_network_type_by_setting.js
rename : dom/network/tests/marionette/test_mobile_roaming_preference.js => dom/mobileconnection/tests/marionette/test_mobile_roaming_preference.js
rename : dom/network/tests/marionette/test_mobile_set_radio.js => dom/mobileconnection/tests/marionette/test_mobile_set_radio.js
rename : dom/network/tests/marionette/test_mobile_voice_state.js => dom/mobileconnection/tests/marionette/test_mobile_voice_state.js
2013-12-24 15:55:52 +08:00

40 lines
1.2 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
SpecialPowers.addPermission("mobileconnection", true, document);
// Permission changes can't change existing Navigator.prototype
// objects, so grab our objects from a new Navigator
let ifr = document.createElement("iframe");
let connection;
ifr.onload = function() {
connection = ifr.contentWindow.navigator.mozMobileConnections[0];
ok(connection instanceof ifr.contentWindow.MozMobileConnection,
"connection is instanceof " + connection.constructor);
testGetCallBarringOption();
};
document.body.appendChild(ifr);
function testGetCallBarringOption() {
let option = {'program': 0, 'password': '', 'serviceClass': 0};
let request = connection.getCallBarringOption(option);
request.onsuccess = function() {
ok(request.result);
ok('enabled' in request.result, 'should have "enabled" field');
cleanUp();
};
request.onerror = function() {
// Call barring is not supported by current emulator.
cleanUp();
};
}
function cleanUp() {
SpecialPowers.removePermission("mobileconnection", document);
finish();
}