Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r920 committed - Fix Issue 123 and add support for custom client ID...

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r920 committed - Fix Issue 123 and add support for custom client ID...


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r920 committed - Fix Issue 123 and add support for custom client ID...
  • Date: Fri, 14 Feb 2014 19:07:12 +0000

Revision: 920
Author:

Date: Fri Feb 14 19:06:48 2014 UTC
Log: Fix Issue 123 and add support for custom client ID

1. Fix Issue 123: The client.application field was
not properly transmitted by the Flash client.

2. Add support for a custom client ID through a
javascript callback getClientApplication().


http://code.google.com/p/ndt/source/detail?r=920

Modified:
/branches/Issue123/flash-client/src/Main.as
/branches/Issue123/flash-client/src/NDTPController.as
/branches/Issue123/flash-client/src/NDTUtils.as
/branches/Issue123/flash-client/src/TestMETA.as

=======================================
--- /branches/Issue123/flash-client/src/Main.as Sun Feb 2 19:14:17 2014 UTC
+++ /branches/Issue123/flash-client/src/Main.as Fri Feb 14 19:06:48 2014 UTC
@@ -26,6 +26,7 @@
public static var locale:String = CONFIG::defaultLocale;
public static var gui:GUI;
public static var server_hostname:String = NDTConstants.SERVER_HOSTNAME;
+ public static var client_application:String = NDTConstants.CLIENT_ID;

public function Main():void {
if (stage)
@@ -45,7 +46,8 @@
// Set the properties of the SWF from HTML tags.
NDTUtils.initializeFromHTML(this.root.loaderInfo.parameters);

- var frame:NDTPController = new NDTPController(server_hostname);
+ var frame:NDTPController = new NDTPController(server_hostname,
+ client_application);

stage.showDefaultContextMenu = false;
if (guiEnabled) {
=======================================
--- /branches/Issue123/flash-client/src/NDTPController.as Sun Feb 2 19:14:17 2014 UTC
+++ /branches/Issue123/flash-client/src/NDTPController.as Fri Feb 14 19:06:48 2014 UTC
@@ -42,9 +42,11 @@
private var _remoteTestResults:String;
private var _testsToRun:Array;
private var _testStage:int;
+ private var _clientApplication:String;

- public function NDTPController(hostname:String) {
+ public function NDTPController(hostname:String, clientApplication:String) {
_hostname = hostname;
+ _clientApplication = clientApplication;

_remoteTestResults = ""
}
@@ -125,7 +127,9 @@
s2c.run();
break;
case TestType.META:
- var meta:TestMETA = new TestMETA(_ctlSocket, this);
+ var meta:TestMETA = new TestMETA(_ctlSocket,
+ _clientApplication,
+ this);
meta.run();
break;
default:
=======================================
--- /branches/Issue123/flash-client/src/NDTUtils.as Fri Feb 14 16:55:41 2014 UTC
+++ /branches/Issue123/flash-client/src/NDTUtils.as Fri Feb 14 19:06:48 2014 UTC
@@ -91,6 +91,20 @@
"Initialized server from JavaScript. Server hostname:"
+ Main.server_hostname);
}
+ } catch(e:Error) {
+ TestResults.appendDebugMsg("Bad Flash permissions: No "
+ + "access to javascript.");
+ }
+ try {
+ var js_client_application:String =
+ ExternalInterface.call("getClientApplication");
+ if (js_client_application) {
+ Main.client_application += js_client_application
+ TestResults.appendDebugMsg(
+ "Initialized client application from JavaScript. " +
+ "Client application: "
+ + Main.client_application);
+ }
} catch(e:Error) {
TestResults.appendDebugMsg("Bad Flash permissions: No "
+ "access to javascript.");
=======================================
--- /branches/Issue123/flash-client/src/TestMETA.as Sun Feb 2 19:14:17 2014 UTC
+++ /branches/Issue123/flash-client/src/TestMETA.as Fri Feb 14 19:06:48 2014 UTC
@@ -37,10 +37,14 @@
private var _metaTestSuccess:Boolean;
private var _msg:Message;
private var _testStage:int;
+ private var _clientApplication:String;

- public function TestMETA(ctlSocket:Socket, callerObject:NDTPController) {
+ public function TestMETA(ctlSocket:Socket,
+ clientApplication:String,
+ callerObject:NDTPController) {
_callerObj = callerObject;
_ctlSocket = ctlSocket;
+ _clientApplication = clientApplication;

_metaTestSuccess = true; // Initially the test has not failed.
}
@@ -192,7 +196,13 @@

bodyToSend.clear();
bodyToSend.writeUTFBytes(new String(
- NDTConstants.META_CLIENT_APPLICATION + ":" + NDTConstants.CLIENT_ID));
+ NDTConstants.META_CLIENT_APPLICATION + ":" + _clientApplication));
+ _msg = new Message(MessageType.TEST_MSG, bodyToSend);
+ if (!_msg.sendMessage(_ctlSocket)) {
+ _metaTestSuccess = false;
+ endTest();
+ return;
+ }

// Client can send any number of such meta data in a TEST_MSG format and
// signal the send of the transmission using an empty TEST_MSG.


  • [ndt-dev] [ndt] r920 committed - Fix Issue 123 and add support for custom client ID..., ndt, 02/14/2014

Archive powered by MHonArc 2.6.16.

Top of Page