mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 978709 - 6/6: test cases. r=hsinyi
This commit is contained in:
parent
141c9429be
commit
41c627df0a
@ -23,4 +23,4 @@ disabled = Bug 808783
|
||||
[test_mobile_connections_array_uninitialized.js]
|
||||
[test_mobile_signal_strength.js]
|
||||
[test_mobile_data_ipv6.js]
|
||||
disabled = Bug 978071
|
||||
disabled = Bug 979137
|
||||
|
@ -24,7 +24,7 @@ MARIONETTE_HEAD_JS = "head.js";
|
||||
*
|
||||
* @return A deferred promise.
|
||||
*/
|
||||
function doTest(aApnSettings, aIsIPv6) {
|
||||
function doTest(aApnSettings, aHaveV4Address, aHaveV6Address) {
|
||||
return setDataApnSettings([])
|
||||
.then(() => setDataApnSettings(aApnSettings))
|
||||
.then(() => setDataEnabledAndWait(true))
|
||||
@ -32,13 +32,23 @@ function doTest(aApnSettings, aIsIPv6) {
|
||||
let nm = getNetworkManager();
|
||||
let active = nm.active;
|
||||
ok(active, "Active network interface");
|
||||
|
||||
log(" Interface: " + active.name);
|
||||
log(" Address: " + active.ip);
|
||||
if (aIsIPv6) {
|
||||
ok(active.ip.indexOf(":") > 0, "IPv6 address");
|
||||
} else {
|
||||
ok(active.ip.indexOf(":") < 0, "IPv4 address");
|
||||
|
||||
let ips = {}, prefixLengths = {};
|
||||
let num = active.getAddresses(ips, prefixLengths);
|
||||
log(" Num addresses: " + num);
|
||||
log(" Addresses: " + JSON.stringify(ips.value));
|
||||
log(" PrefixLengths: " + JSON.stringify(prefixLengths.value));
|
||||
|
||||
if (aHaveV4Address) {
|
||||
ok(ips.value.reduce(function(aFound, aAddress) {
|
||||
return aFound || aAddress.indexOf(":") < 0;
|
||||
}), "IPv4 address");
|
||||
}
|
||||
if (aHaveV6Address) {
|
||||
ok(ips.value.reduce(function(aFound, aAddress) {
|
||||
return aFound || aAddress.indexOf(":") > 0;
|
||||
}), "IPv6 address");
|
||||
}
|
||||
})
|
||||
.then(() => setDataEnabledAndWait(false));
|
||||
@ -54,7 +64,9 @@ function doTestHome(aApnSettings, aProtocol) {
|
||||
aApnSettings[0][0].protocol = aProtocol;
|
||||
delete aApnSettings[0][0].roaming_protocol;
|
||||
|
||||
return doTest(aApnSettings, aProtocol === "IPV6");
|
||||
return doTest(aApnSettings,
|
||||
aProtocol === "IP" || aProtocol === "IPV4V6",
|
||||
aProtocol === "IPV4V6" || aProtocol === "IPV6");
|
||||
}
|
||||
|
||||
function doTestRoaming(aApnSettings, aRoaminProtocol) {
|
||||
@ -67,7 +79,9 @@ function doTestRoaming(aApnSettings, aRoaminProtocol) {
|
||||
delete aApnSettings[0][0].protocol;
|
||||
aApnSettings[0][0].roaming_protocol = aRoaminProtocol;
|
||||
|
||||
return doTest(aApnSettings, aRoaminProtocol === "IPV6");
|
||||
return doTest(aApnSettings,
|
||||
aRoaminProtocol === "IP" || aRoaminProtocol === "IPV4V6",
|
||||
aRoaminProtocol === "IPV4V6" || aRoaminProtocol === "IPV6");
|
||||
}
|
||||
|
||||
startTestCommon(function() {
|
||||
@ -92,12 +106,14 @@ startTestCommon(function() {
|
||||
|
||||
.then(() => doTestHome(aApnSettings, "NoSuchProtocol"))
|
||||
.then(() => doTestHome(aApnSettings, "IP"))
|
||||
.then(() => doTestHome(aApnSettings, "IPV4V6"))
|
||||
.then(() => doTestHome(aApnSettings, "IPV6"))
|
||||
|
||||
.then(() => setEmulatorRoamingAndWait(true))
|
||||
|
||||
.then(() => doTestRoaming(aApnSettings, "NoSuchProtocol"))
|
||||
.then(() => doTestRoaming(aApnSettings, "IP"))
|
||||
.then(() => doTestRoaming(aApnSettings, "IPV4V6"))
|
||||
.then(() => doTestRoaming(aApnSettings, "IPV6"))
|
||||
|
||||
.then(() => setEmulatorRoamingAndWait(false));
|
||||
|
Loading…
Reference in New Issue
Block a user