Skip to content

Commit

Permalink
Change test that asserts isReachable returns NetworkStatus.code to su…
Browse files Browse the repository at this point in the history
…ccess callback.

All platforms (iOS, Android, BB) now return a NetworkStatus constant without using NetworkStatus.code property.
  • Loading branch information
Justin Tyberg committed Oct 29, 2010
1 parent d6472c2 commit f22b6a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/network.tests.js
Expand Up @@ -16,14 +16,14 @@ Tests.prototype.NetworkTests = function() {
equals(NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK, 1, "NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK is equal to 1.");
equals(NetworkStatus.REACHABLE_VIA_WIFI_NETWORK, 2, "NetworkStatus.REACHABLE_VIA_WIFI_NETWORK is equal to 2.");
});
test("isReachable function should return an object with a 'code' member as a NetworkStatus constant in its success callback", function() {
test("isReachable function should return one of the defined NetworkStatus constants to its success callback", function() {
expect(1);
QUnit.stop(Tests.TEST_TIMEOUT);
var hostname = "http://www.google.com";
var win = function(p) {
ok(p.code == NetworkStatus.NOT_REACHABLE || p.code == NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK || p.code == NetworkStatus.REACHABLE_VIA_WIFI_NETWORK, "Success callback in isReachable returns a proper object with a 'code' member equal to a NetworkStatus constant.");
var win = function(code) {
ok(code == NetworkStatus.NOT_REACHABLE || code == NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK || code == NetworkStatus.REACHABLE_VIA_WIFI_NETWORK, "Success callback in isReachable returns one of the defined NetworkStatus constants.");
start();
};
navigator.network.isReachable(hostname, win);
});
};
};

0 comments on commit f22b6a9

Please sign in to comment.