Test Latency with callback to jam client working now.
This commit is contained in:
parent
b4fcd0fdee
commit
7b78ec225b
|
|
@ -8,11 +8,12 @@
|
|||
logger.info("*** Fake JamClient instance initialized. ***");
|
||||
|
||||
function testLatency(client, callbackFunctionName) {
|
||||
logger.debug("Fake JamClient: testLatency called with client, " + client + " and callback function name: " + callbackFunctionName);
|
||||
var response = {
|
||||
id: client.id,
|
||||
latency: 50
|
||||
};
|
||||
var js = callbackFunctionName + "(" + response + ");";
|
||||
var js = callbackFunctionName + "(" + JSON.stringify(response) + ");";
|
||||
eval(js);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,14 +76,13 @@
|
|||
|
||||
function testLatencyHandler(evt) {
|
||||
var clientId = $(selectors.testLatency + ' input[type="text"]').val();
|
||||
logger.debug('testLatencyHandler: clientId: ' + clientId);
|
||||
logger.debug('TODO: need to change TestLatency to accept string function name');
|
||||
// TODO: Change 2nd param to string like below. Update fakeJamClient
|
||||
// and any tests that break to take a string naming the function to call.
|
||||
//context.jamClient.TestLatency(clientId, 'JK.TestBridgeLatencyResponse');
|
||||
logger.debug('testBridge Screen: testLatencyHandler: clientId: ' + clientId);
|
||||
var jsFunction = "JK.TestBridgeLatencyResponse";
|
||||
context.jamClient.TestLatency(clientId, jsFunction);
|
||||
}
|
||||
|
||||
function latencyResponse(response) {
|
||||
logger.debug("latencyResponse, called from jamClient: " + response);
|
||||
var latency = response.latency;
|
||||
$(selectors.testLatencyResponse).html(latency);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<input type="button" value="Join!"/>
|
||||
</label>
|
||||
</div>
|
||||
<div id="testBridge-TestLatency">
|
||||
<div id="testBridge-TestLatency" style="clear:both;">
|
||||
<h2>TestLatency</h2>
|
||||
<label>Client ID (to ping)
|
||||
<input type="text" style="width:300px"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue