goog.net.NetworkTester
Classgoog.net.NetworkTester(callback, opt_handler, opt_uri)
Creates an instance of goog.net.NetworkTester which can be used to test for internet connectivity by seeing if an image can be loaded from google.com. It can also be tested with other URLs.
callback
{Function
}
opt_handler
{Object
=}
opt_uri
{goog.Uri
=}
.DEFAULT_TIMEOUT_MS
{number
}Default timeout
.getNumRetries()
Returns the numer of retries to attempt.
number
}
.getPauseBetweenRetries()
Returns the pause between retries in milliseconds.
number
}
.getTimeout()
Returns the timeout in milliseconds.
number
}
.getUri()
Returns the uri to use for the test.
goog.Uri
}
.isRunning()
Returns whether the tester is currently running.
boolean
}
.onResult(succeeded)
Handles a successful or failed result.
succeeded
{boolean
}
.setNumRetries(retries)
Sets the timeout in milliseconds.
retries
{number
}
.setPauseBetweenRetries(pauseMs)
Sets the pause between retries in milliseconds.
pauseMs
{number
}
.setTimeout(timeoutMs)
Sets the timeout in milliseconds.
timeoutMs
{number
}
.setUri(uri)
Sets the uri to use for the test.
uri
{goog.Uri
}
.start()
Starts the process of testing the network.
.stop()
Stops the testing of the network. This is a noop if not running.