ndt-dev - [ndt-dev] [ndt] r948 committed - Merged Issue123 branch to resolve Issue 123. (Properly, this time.)
Subject: NDT-DEV email list created
List archive
[ndt-dev] [ndt] r948 committed - Merged Issue123 branch to resolve Issue 123. (Properly, this time.)
Chronological Thread
- From:
- To:
- Subject: [ndt-dev] [ndt] r948 committed - Merged Issue123 branch to resolve Issue 123. (Properly, this time.)
- Date: Thu, 20 Feb 2014 20:24:14 +0000
Revision: 948
Author:
Date: Thu Feb 20 20:24:05 2014 UTC
Log: Merged Issue123 branch to resolve Issue 123. (Properly, this time.)
http://code.google.com/p/ndt/source/detail?r=948
Modified:
/trunk/flash-client/src/Main.as
/trunk/flash-client/src/NDTPController.as
/trunk/flash-client/src/NDTUtils.as
/trunk/flash-client/src/TestMETA.as
=======================================
--- /trunk/flash-client/src/Main.as Thu Feb 20 20:16:30 2014 UTC
+++ /trunk/flash-client/src/Main.as Thu Feb 20 20:24:05 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) {
=======================================
--- /trunk/flash-client/src/NDTPController.as Thu Feb 20 20:16:30 2014 UTC
+++ /trunk/flash-client/src/NDTPController.as Thu Feb 20 20:24:05 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:
=======================================
--- /trunk/flash-client/src/NDTUtils.as Thu Feb 20 20:16:30 2014 UTC
+++ /trunk/flash-client/src/NDTUtils.as Thu Feb 20 20:24:05 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.");
=======================================
--- /trunk/flash-client/src/TestMETA.as Thu Feb 20 20:16:30 2014 UTC
+++ /trunk/flash-client/src/TestMETA.as Thu Feb 20 20:24:05 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] r948 committed - Merged Issue123 branch to resolve Issue 123. (Properly, this time.), ndt, 02/20/2014
Archive powered by MHonArc 2.6.16.