Bug 1159132 - Part 2: Set ro.tethering.dun_required when running dun test case. r=echen

This commit is contained in:
Jessica Jong 2015-05-04 02:33:00 -04:00
parent b2c9e7b2d9
commit 6367e72157
3 changed files with 12 additions and 0 deletions

View File

@ -218,6 +218,14 @@ let gTestSuite = (function() {
return setSettings1(SETTINGS_KEY_DATA_APN_SETTINGS, aApnSettings, aAllowError);
}
/**
* Set 'ro.tethering.dun_required' system property to 1. Note that this is a
* 'ro' property, it can only be set once.
*/
function setTetheringDunRequired() {
return runEmulatorShellSafe(['setprop', 'ro.tethering.dun_required', '1']);
}
/**
* Wrap DOMRequest onsuccess/onerror events to Promise resolve/reject.
*
@ -704,6 +712,7 @@ let gTestSuite = (function() {
suite.setWifiTetheringEnabled = setWifiTetheringEnabled;
suite.getDataApnSettings = getDataApnSettings;
suite.setDataApnSettings = setDataApnSettings;
suite.setTetheringDunRequired = setTetheringDunRequired;
/**

View File

@ -4,4 +4,6 @@ browser = false
qemu = true
[test_wifi_tethering_enabled.js]
; The following test must be the last tethering test ran, as it sets the
; 'ro.tethering.dun_required' property.
[test_wifi_tethering_dun.js]

View File

@ -22,6 +22,7 @@ gTestSuite.startTest(function() {
"types": ["dun"] } ]];
return gTestSuite.setDataApnSettings(apnSettings);
})
.then(() => gTestSuite.setTetheringDunRequired())
.then(() => gTestSuite.startTetheringTest(function() {
return gTestSuite.ensureWifiEnabled(false)
.then(() => gTestSuite.setWifiTetheringEnabled(true, true))