summaryrefslogtreecommitdiff
path: root/js/test/Ice/acm
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2017-01-30 13:45:21 -0800
committerMark Spruiell <mes@zeroc.com>2017-01-30 13:45:21 -0800
commit61270a10f980933cf582edb766f10c8ac6d86e8a (patch)
tree45ab4a7c2986954054fce613bc3c8f7967e7951e /js/test/Ice/acm
parentFix slice2cpp build failure (diff)
downloadice-61270a10f980933cf582edb766f10c8ac6d86e8a.tar.bz2
ice-61270a10f980933cf582edb766f10c8ac6d86e8a.tar.xz
ice-61270a10f980933cf582edb766f10c8ac6d86e8a.zip
merging IceBridge into master
Diffstat (limited to 'js/test/Ice/acm')
-rw-r--r--js/test/Ice/acm/Client.js34
-rw-r--r--js/test/Ice/acm/Test.ice3
2 files changed, 35 insertions, 2 deletions
diff --git a/js/test/Ice/acm/Client.js b/js/test/Ice/acm/Client.js
index e18f45ec0ac..58f8efdf313 100644
--- a/js/test/Ice/acm/Client.js
+++ b/js/test/Ice/acm/Client.js
@@ -391,6 +391,37 @@
}
}
+ class HeartbeatManualTest extends TestCase
+ {
+ constructor(com, out)
+ {
+ super("manual heartbeats", com, out);
+ //
+ // Disable heartbeats.
+ //
+ this.setClientACM(10, -1, 0);
+ this.setServerACM(10, -1, 0);
+ }
+
+ runTestCase(adapter, proxy)
+ {
+ function sendHeartbeats(con)
+ {
+ var p = Promise.resolve();
+ for(var i = 0; i < 5; ++i)
+ {
+ p = p.then(con.heartbeat());
+ }
+ return p;
+ }
+
+ return proxy.startHeartbeatCount().then(
+ () => proxy.ice_getConnection()).then(
+ con => sendHeartbeats(con)).then(
+ () => proxy.waitForHeartbeatCount(5));
+ }
+ }
+
class SetACMTest extends TestCase
{
constructor(com, out)
@@ -421,7 +452,7 @@
test(acm.close === Ice.ACMClose.CloseOnInvocationAndIdle);
test(acm.heartbeat === Ice.ACMHeartbeat.HeartbeatAlways);
- return proxy.waitForHeartbeat(2);
+ return proxy.startHeartbeatCount().then(() => proxy.waitForHeartbeatCount(2));
}
}
@@ -459,6 +490,7 @@
tests.push(new HeartbeatOnIdleTest(com, out));
tests.push(new HeartbeatAlwaysTest(com, out));
+ tests.push(new HeartbeatManualTest(com, out));
tests.push(new SetACMTest(com, out));
}
diff --git a/js/test/Ice/acm/Test.ice b/js/test/Ice/acm/Test.ice
index 117192a2df8..7f71427c741 100644
--- a/js/test/Ice/acm/Test.ice
+++ b/js/test/Ice/acm/Test.ice
@@ -18,7 +18,8 @@ interface TestIntf
void sleep(int seconds);
void sleepAndHold(int seconds);
void interruptSleep();
- void waitForHeartbeat(int count);
+ void startHeartbeatCount();
+ void waitForHeartbeatCount(int count);
};
interface RemoteObjectAdapter