Commit 778e47ed authored by Glenn Adams's avatar Glenn Adams

Updatte wsp helper.

parent 89fc99c1
This diff is collapsed.
...@@ -14,16 +14,19 @@ function run(tOuter) { ...@@ -14,16 +14,19 @@ function run(tOuter) {
ws.send(data); ws.send(data);
assert_equals(ws.bufferedAmount, data.length); assert_equals(ws.bufferedAmount, data.length);
tData = async_test(defProperties.expandedName + '-check-data'); tData = async_test(defProperties.expandedName + '-check-data');
ws.onmessage = tData.step_func_done(function(evt) {
assert_equals(evt.data, data);
ws.close();
tDone = async_test(defProperties.expandedName + '-check-done');
ws.onclose = tDone.step_func_done(function(evt) {
assert_true(open);
open = false;
assert_true(evt.wasClean);
});
});
}); });
ws.onmessage = tData.step_func_done(function(evt) { ws.onerror = tOpen.step_func_done(function() {
assert_equals(evt.data, data); assert_unreached('web socket error');
ws.close();
tDone = async_test(defProperties.expandedName + '-check-done');
});
ws.onclose = tDone.step_func_done(function(evt) {
assert_true(open);
open = false;
assert_true(evt.wasClean);
tOuter.done();
}); });
tOuter.done();
} }
...@@ -14,16 +14,19 @@ function run(tOuter) { ...@@ -14,16 +14,19 @@ function run(tOuter) {
ws.send(data); ws.send(data);
assert_equals(ws.bufferedAmount, data.length); assert_equals(ws.bufferedAmount, data.length);
tData = async_test(defProperties.expandedName + '-check-data'); tData = async_test(defProperties.expandedName + '-check-data');
ws.onmessage = tData.step_func_done(function(evt) {
assert_equals(evt.data, data);
ws.close();
tDone = async_test(defProperties.expandedName + '-check-done');
ws.onclose = tDone.step_func_done(function(evt) {
assert_true(open);
open = false;
assert_true(evt.wasClean);
});
});
}); });
ws.onmessage = tData.step_func_done(function(evt) { ws.onerror = tOpen.step_func_done(function() {
assert_equals(evt.data, data); assert_unreached('web socket error');
ws.close();
tDone = async_test(defProperties.expandedName + '-check-done');
});
ws.onclose = tDone.step_func_done(function(evt) {
assert_true(open);
open = false;
assert_true(evt.wasClean);
tOuter.done();
}); });
tOuter.done();
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment