ndt-dev - [ndt-dev] [ndt] r1120 committed - Add set_host javascript method.
Subject: NDT-DEV email list created
List archive
- From:
- To:
- Subject: [ndt-dev] [ndt] r1120 committed - Add set_host javascript method.
- Date: Fri, 11 Jul 2014 01:43:21 +0000
Revision: 1120
Author:
Date: Fri Jul 11 01:42:49 2014 UTC
Log: Add set_host javascript method.
http://code.google.com/p/ndt/source/detail?r=1120
Modified:
/branches/flash-scriptability/flash-client/src/NDTPController.as
/branches/flash-scriptability/flash-client/src/NDTUtils.as
=======================================
--- /branches/flash-scriptability/flash-client/src/NDTPController.as Wed Jun 18 07:06:05 2014 UTC
+++ /branches/flash-scriptability/flash-client/src/NDTPController.as Fri Jul 11 01:42:49 2014 UTC
@@ -76,6 +76,8 @@
if (js_server_hostname) {
Main.server_hostname = js_server_hostname;
_hostname = Main.server_hostname;
+ } else if (Main.server_hostname) {
+ _hostname = Main.server_hostname;
}
TestResults.recordStartTime();
=======================================
--- /branches/flash-scriptability/flash-client/src/NDTUtils.as Wed Jun 18 07:06:05 2014 UTC
+++ /branches/flash-scriptability/flash-client/src/NDTUtils.as Fri Jul 11 01:42:49 2014 UTC
@@ -59,6 +59,22 @@
}
}
}
+
+ /**
+ * Function that initializes the NDT server variable set directly through JS.
+ */
+ public static function setHost(hostname:String):String {
+ var js_server_hostname:String = hostname;
+ if (js_server_hostname) {
+ Main.server_hostname = js_server_hostname;
+ TestResults.appendDebugMsg(
+ "Initialized server from JavaScript. Server hostname:"
+ + Main.server_hostname);
+ } else {
+ js_server_hostname = null;
+ }
+ return js_server_hostname;
+ }
/**
* Function that initializes the NDT server variable.
@@ -201,6 +217,8 @@
"get_PcBuffSpdLimit", TestResults.getPcLimit);
ExternalInterface.addCallback(
"getNDTvar", TestResultsUtils.getNDTVariable);
+ ExternalInterface.addCallback(
+ "set_host", NDTUtils.setHost);
} catch (e:Error) {
// TODO(tiziana): Find out why ExternalInterface.available does not work
// in some cases and this exception is raised.
- [ndt-dev] [ndt] r1120 committed - Add set_host javascript method., ndt, 07/11/2014
Archive powered by MHonArc 2.6.16.