Sandbox-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
June 2015
- 4 participants
- 174 discussions
Author: ygrego
Date: 2015-06-10 12:05:46 +0000 (Wed, 10 Jun 2015)
New Revision: 1688
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1688
Log:
The file style.css are unnecessary.
Removed:
oipf/test/css/style.css
Deleted: oipf/test/css/style.css
===================================================================
--- oipf/test/css/style.css 2015-06-10 11:58:23 UTC (rev 1687)
+++ oipf/test/css/style.css 2015-06-10 12:05:46 UTC (rev 1688)
@@ -1,29 +0,0 @@
-body {
- background-image: url("../img/TV-T&PC.svg");
- background-repeat: no-repeat;
- background-size: cover;
- background-position: center;
-}
-
-#video-broadcast {
- position: absolute;
- z-index: -1;
- background-image: url("../img/video-broadcast.jpg");
- background-size: cover;
- background-repeat: no-repeat;
- margin-left: 11%;
- height: 90%;
- width: 60%;
-}
-
-#prog {
- z-index: 2;
- background-color:gray;
- height: 40%;
- width: 40%;
- color:white;
- margin-left: 20%;
- margin-right: 40%;
- overflow-y: auto;
- visibility: hidden;
-}
\ No newline at end of file
1
0
Author: ygrego
Date: 2015-06-10 11:58:23 +0000 (Wed, 10 Jun 2015)
New Revision: 1687
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1687
Log:
The classes concerned by this this commit have been transformed in ES6 classes.
Modified:
oipf/test/js/ApplicationManagerTest.js
oipf/test/js/CapabilitiesTest.js
oipf/test/js/ConfigurationTest.js
oipf/test/js/OipfFactoryTest.js
oipf/test/js/ParentalControlManagerTest.js
oipf/test/js/RecordingSchedulerTest.js
oipf/test/js/SearchManagerTest.js
oipf/test/js/Test.js
oipf/test/js/TestCase.js
oipf/test/js/TestConfig.js
oipf/test/js/VideoBroadcastTest.js
Modified: oipf/test/js/ApplicationManagerTest.js
===================================================================
--- oipf/test/js/ApplicationManagerTest.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/ApplicationManagerTest.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -1,50 +1,50 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var ApplicationManagerTest = TestCase.extend({
-
- init: function() {
- this.super.init();
+class ApplicationManagerTest extends TestCase {
+
+ constructor() {
+ super();
this.applicationManagerObject = oipfObjectFactory.createApplicationManagerObject();
this.applicationManagerObject.onApplicationLoaded = this.onApplicationLoaded;
- },
-
- beforeTest: function(resolve, reject) {
-
- },
-
- afterTest: function(resolve, reject) {
-
- },
-
- onApplicationLoaded: function(application) {
- console.log(application);
- },
-
- testGetOwnerApplicationOfDocumentOfGlobalPropertyWindow: function(resolve, reject) {
+ }
+
+ beforeTest(resolve, reject) {
+
+ }
+
+ afterTest(resolve, reject) {
+
+ }
+
+ onApplicationLoaded(application) {
+ console.log(application);
+ }
+
+ testGetOwnerApplicationOfDocumentOfGlobalPropertyWindow(resolve, reject) {
var application = this.applicationManagerObject
.getOwnerApplication(window.document);
-
+
if (!this.assertEquals(application, null)) {
resolve();
} else {
reject();
}
- },
-
- testGetOwnerApplicationWithNull: function(resolve, reject) {
+ }
+
+ testGetOwnerApplicationWithNull(resolve, reject) {
var application = this.applicationManagerObject
.getOwnerApplication(null);
-
+
if (this.assertEquals(application, null)) {
resolve();
} else {
reject();
}
- },
-
-});
+ }
+}
+
Modified: oipf/test/js/CapabilitiesTest.js
===================================================================
--- oipf/test/js/CapabilitiesTest.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/CapabilitiesTest.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -1,28 +1,29 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var CapabilitiesTest = TestCase.extend({
- init: function() {
- this.super.init();
- },
-
- beforeTest: function() {
+class CapabilitiesTest extends TestCase {
+
+ constructor() {
+ super();
+ }
+
+ beforeTest() {
this.capabilitiesObject = oipfObjectFactory.createCapabilitiesObject();
- },
-
- afterTest: function() {
-
- },
-
+ }
+
+ afterTest() {
+
+ }
+
/*
- * FIXME:
+ * FIXME:
* Yannis - 12/05/2015 - Instanciation of variable everyProperties.
*/
- testOIFPNormConformityOfObject: function(resolve, reject) {
+ testOIFPNormConformityOfObject(resolve, reject) {
var everyProperties;
-
+
for (var i = 0, l = everyProperties.length; i < l; i++) {
var currentProperty = everyProperties[i];
if (!this.capabilitiesObject[currentProperty]) {
@@ -31,220 +32,220 @@
}
}
resolve();
- },
-
- testHasCapabilityWithAnInvalidProfileName: function(resolve, reject) {
+ }
+
+ testHasCapabilityWithAnInvalidProfileName(resolve, reject) {
var profileName = "Toto";
var result = this.capabilitiesObject.hasCapability(profileName);
-
+
if (result) {
reject();
} else {
resolve();
}
- },
-
- testHasCapabilityForAtLeastOneBaseProfileName: function(resolve, reject) {
+ }
+
+ testHasCapabilityForAtLeastOneBaseProfileName(resolve, reject) {
var baseProfileNameList = this.modelFactory
.getCapabilitiesProperties().baseUIProfileName;
var supportedProfileNumber = 0;
-
+
for (var i = 0, l = baseProfileNameList.length; i < l; i++) {
var baseProfileName = baseProfileNameList[i];
var result = this.capabilitiesObject.hasCapability(baseProfileName);
result && supportedProfileNumber++;
}
-
+
if (supportedProfileNumber > 0) {
resolve();
} else {
reject();
}
- },
-
- testHasCapabilityForAllUIFragmentProfile: function(resolve, reject) {
+ }
+
+ testHasCapabilityForAllUIFragmentProfile(resolve, reject) {
var UIProfileNameFragmentList = this.modelFactory
.getCapabilitiesProperties().UIProfileNameFragment;
var supportedProfileNumber = 0;
-
+
for (var i = 0, l = UIProfileNameFragmentList.length; i < l; i++) {
var UIProfileNameFragment = UIProfileNameFragmentList[i];
var result = this.capabilitiesObject
.hasCapability(UIProfileNameFragment);
result && supportedProfileNumber++;
}
-
+
if (supportedProfileNumber == UIProfileNameFragmentList.length) {
resolve();
} else {
reject();
}
- },
-
- getCapabilityAndNotifyResult: function(resolve, reject, profileName) {
+ }
+
+ getCapabilityAndNotifyResult(resolve, reject, profileName) {
var result = this.capabilitiesObject.hasCapability(profileName);
-
+
if (result) {
resolve();
} else {
reject();
}
- },
-
- testHasCapabilityTRICKMODE: function(resolve, reject) {
- var profileName = "+TRICKMODE";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ }
- testHasCapabilityAVCAD: function(resolve, reject) {
- var profileName = "+AVCAD";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityTRICKMODE(resolve, reject) {
+ var profileName = "+TRICKMODE";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityDL: function(resolve, reject) {
- var profileName = "+DL";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityAVCAD(resolve, reject) {
+ var profileName = "+AVCAD";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityIPTV_SDS: function(resolve, reject) {
- var profileName = "+IPTV_SDS";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityDL(resolve, reject) {
+ var profileName = "+DL";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityIPTV_URI: function(resolve, reject) {
- var profileName = "+IPTV_URI";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityIPTV_SDS(resolve, reject) {
+ var profileName = "+IPTV_SDS";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityANA: function(resolve, reject) {
- var profileName = "+ANA";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityIPTV_URI(resolve, reject) {
+ var profileName = "+IPTV_URI";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityDVB_C: function(resolve, reject) {
- var profileName = "+DVB_C";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityANA(resolve, reject) {
+ var profileName = "+ANA";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityDVB_T: function(resolve, reject) {
- var profileName = "+DVB_T";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityDVB_C(resolve, reject) {
+ var profileName = "+DVB_C";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityDVB_S: function(resolve, reject) {
- var profileName = "+DVB_S";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityDVB_T(resolve, reject) {
+ var profileName = "+DVB_T";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityDVB_C2: function(resolve, reject) {
- var profileName = "+DVB_C2";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityDVB_S(resolve, reject) {
+ var profileName = "+DVB_S";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityDVB_T2: function(resolve, reject) {
- var profileName = "+DVB_T2";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityDVB_C2(resolve, reject) {
+ var profileName = "+DVB_C2";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityDVB_S2: function(resolve, reject) {
- var profileName = "+DVB_S2";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityDVB_T2(resolve, reject) {
+ var profileName = "+DVB_T2";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityISDB_C: function(resolve, reject) {
- var profileName = "+ISDB_C";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityDVB_S2(resolve, reject) {
+ var profileName = "+DVB_S2";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityISDB_T: function(resolve, reject) {
- var profileName = "+ISDB_T";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityISDB_C(resolve, reject) {
+ var profileName = "+ISDB_C";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityISDB_S: function(resolve, reject) {
- var profileName = "+ISDB_S";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityISDB_T(resolve, reject) {
+ var profileName = "+ISDB_T";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityMETA_BCG: function(resolve, reject) {
- var profileName = "+META_BCG";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityISDB_S(resolve, reject) {
+ var profileName = "+ISDB_S";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityMETA_EIT: function(resolve, reject) {
- var profileName = "+META_EIT";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityMETA_BCG(resolve, reject) {
+ var profileName = "+META_BCG";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityMETA_SI: function(resolve, reject) {
- var profileName = "+META_SI";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityMETA_EIT(resolve, reject) {
+ var profileName = "+META_EIT";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityITV_KEYS: function(resolve, reject) {
- var profileName = "+ITV_KEYS";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityMETA_SI(resolve, reject) {
+ var profileName = "+META_SI";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityCONTROLLED: function(resolve, reject) {
- var profileName = "+CONTROLLED";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
-
- testHasCapabilityPVR: function(resolve, reject) {
+ testHasCapabilityITV_KEYS(resolve, reject) {
+ var profileName = "+ITV_KEYS";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
+
+ testHasCapabilityCONTROLLED(resolve, reject) {
+ var profileName = "+CONTROLLED";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
+
+ testHasCapabilityPVR(resolve, reject) {
var profileName = "+PVR";
this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
-
- testHasCapabilityDRM: function(resolve, reject) {
- var profileName = "+DRM";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ }
- testHasCapabilityCommunicationServices: function(resolve, reject) {
- var profileName = "+CommunicationServices";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityDRM(resolve, reject) {
+ var profileName = "+DRM";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilitySVG: function(resolve, reject) {
- var profileName = "+SVG";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityCommunicationServices(resolve, reject) {
+ var profileName = "+CommunicationServices";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityPOINTER: function(resolve, reject) {
- var profileName = "+POINTER";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilitySVG(resolve, reject) {
+ var profileName = "+SVG";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityPOLLNOTIF: function(resolve, reject) {
- var profileName = "+POLLNOTIF";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityPOINTER(resolve, reject) {
+ var profileName = "+POINTER";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityHtml5Media: function(resolve, reject) {
- var profileName = "+HTML5_MEDIA";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityPOLLNOTIF(resolve, reject) {
+ var profileName = "+POLLNOTIF";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityWIDGETS: function(resolve, reject) {
- var profileName = "+WIDGETS";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityHtml5Media(resolve, reject) {
+ var profileName = "+HTML5_MEDIA";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityRCF: function(resolve, reject) {
- var profileName = "+RCF";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityWIDGETS(resolve, reject) {
+ var profileName = "+WIDGETS";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityTELEPHONY: function(resolve, reject) {
- var profileName = "+TELEPHONY";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
- },
+ testHasCapabilityRCF(resolve, reject) {
+ var profileName = "+RCF";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
- testHasCapabilityVIDEOTELEPHONY: function(resolve, reject) {
- var profileName = "+VIDEOTELEPHONY";
- this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ testHasCapabilityTELEPHONY(resolve, reject) {
+ var profileName = "+TELEPHONY";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
}
-});
+ testHasCapabilityVIDEOTELEPHONY(resolve, reject) {
+ var profileName = "+VIDEOTELEPHONY";
+ this.getCapabilityAndNotifyResult(resolve, reject, profileName);
+ }
+}
+
Modified: oipf/test/js/ConfigurationTest.js
===================================================================
--- oipf/test/js/ConfigurationTest.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/ConfigurationTest.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -1,26 +1,26 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var ConfigurationTest = TestCase.extend({
-
- init: function() {
- this.super.init();
- },
-
- beforeTest: function(resolve, reject) {
+class ConfigurationTest extends TestCase {
+
+ constructor() {
+ super();
+ }
+
+ beforeTest(resolve, reject) {
this.configurationObject = oipfObjectFactory.createConfigurationObject();
this.localSystem = this.configurationObject.localSystem;
- logTest("State: Pending");
- },
-
- testSetScreenSize : function(resolve, reject){
+ OipfUtils.logTest("State: Pending");
+ }
+ testSetScreenSize(resolve, reject) {
+
if (this.localSystem) {
var result = this.localSystem.setScreenSize(1280, 720);
-
+
if (result) {
resolve();
} else {
@@ -29,43 +29,43 @@
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetScreenSizeWithoutParameters: function(resolve, reject) {
+ }
+ testSetScreenSizeWithoutParameters(resolve, reject) {
+
if (this.localSystem) {
this.waitForError(this.localSystem.setScreenSize, resolve);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetScreenSizeWithUnexpectedTypeParameters: function(resolve, reject) {
+ }
+ testSetScreenSizeWithUnexpectedTypeParameters(resolve, reject) {
+
if (this.localSystem) {
-
+
this.waitForError(
- this.localSystem.setScreenSize.bind(this.localSystem, "", ""),
+ this.localSystem.setScreenSize.bind(this.localSystem, "", ""),
resolve);
-
+
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetScreenSizeWithExcessiveParametersNumber: function(resolve, reject) {
+ }
+ testSetScreenSizeWithExcessiveParametersNumber(resolve, reject) {
+
if (this.localSystem) {
this.waitForError(
- this.localSystem.setScreenSize.bind(this.localSystem, 640, 480, 854),
+ this.localSystem.setScreenSize.bind(this.localSystem, 640, 480, 854),
resolve);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetTvStandard: function(resolve, reject) {
+ }
+ testSetTvStandard(resolve, reject) {
+
if (this.localSystem) {
var result = this.localSystem.setTVStandard(4);
if (result) {
@@ -76,42 +76,42 @@
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetTvStandardWihtoutParameters: function(resolve, reject) {
+ }
+ testSetTvStandardWihtoutParameters(resolve, reject) {
+
if (this.localSystem) {
this.waitForError(this.localSystem.setTVStandard, resolve);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetTvStandardWithUnexpectedTypeParameters: function(resolve, reject) {
+ }
+ testSetTvStandardWithUnexpectedTypeParameters(resolve, reject) {
+
if (this.localSystem) {
this.waitForError(
- this.localSystem.setTVStandard.bind(this.localSystem, ""),
+ this.localSystem.setTVStandard.bind(this.localSystem, ""),
resolve);
-
+
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetTvStandardWithExcessiveParametersNumber: function(resolve, reject) {
+ }
+ testSetTvStandardWithExcessiveParametersNumber(resolve, reject) {
+
if (this.localSystem) {
this.waitForError(
- this.localSystem.setTVStandard.bind(this.localSystem, 4, 4),
+ this.localSystem.setTVStandard.bind(this.localSystem, 4, 4),
resolve);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetPvrSupport: function(resolve, reject) {
+ }
+ testSetPvrSupport(resolve, reject) {
+
if (this.localSystem) {
var result = this.localSystem.setPvrSupport(1);
if (result) {
@@ -122,41 +122,41 @@
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetPvrSupportWithoutParameters: function(resolve, reject) {
+ }
+ testSetPvrSupportWithoutParameters(resolve, reject) {
+
if (this.localSystem) {
this.waitForError(this.localSystem.setPvrSupport, resolve);
} else {
throw new Error("Unexpected error");
}
- },
+ }
- testSetPvrSupportWithUnexpectedTypeParameters: function(resolve, reject) {
+ testSetPvrSupportWithUnexpectedTypeParameters(resolve, reject) {
if (this.localSystem) {
this.waitForError(
- this.localSystem.setPvrSupport.bind(this.localSystem, {}),
+ this.localSystem.setPvrSupport.bind(this.localSystem, {}),
resolve);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetPvrSupportWithExcessiveParametersNumber: function(resolve, reject) {
+ }
+ testSetPvrSupportWithExcessiveParametersNumber(resolve, reject) {
+
if (this.localSystem) {
this.waitForError(
- this.localSystem.setPvrSupport.bind(this.localSystem, 0, 0, 0),
+ this.localSystem.setPvrSupport.bind(this.localSystem, 0, 0, 0),
resolve);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetPowerState: function(resolve, reject) {
+ }
+ testSetPowerState(resolve, reject) {
+
if (this.localSystem) {
var result = this.localSystem.setPowerState();
if (result) {
@@ -167,149 +167,149 @@
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetPowerStateWithoutParameters: function(resolve, reject) {
+ }
+ testSetPowerStateWithoutParameters(resolve, reject) {
+
if (this.localSystem) {
this.waitForError(this.localSystem.setPowerState, resolve);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetPowerStateWithUnexpectedTypeParameters: function(resolve, reject) {
+ }
+ testSetPowerStateWithUnexpectedTypeParameters(resolve, reject) {
+
if (this.localSystem) {
this.waitForError(
- this.localSystem.setPowerState.bind(this.localSystem, {}),
+ this.localSystem.setPowerState.bind(this.localSystem, {}),
resolve);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetPowerStateWithExcessiveParametersNumber: function(resolve, reject) {
+ }
+ testSetPowerStateWithExcessiveParametersNumber(resolve, reject) {
+
if (this.localSystem) {
this.waitForError(
- this.localSystem.setPowerState.bind(this.localSystem, 0, 0, 0),
+ this.localSystem.setPowerState.bind(this.localSystem, 0, 0, 0),
resolve);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetDigestCredentials: function(resolve, reject) {
+ }
+ testSetDigestCredentials(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.setDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetDigestCredentialsWithoutParameters: function(resolve, reject) {
+ }
+ testSetDigestCredentialsWithoutParameters(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.setDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetDigestCredentialsWithUnexpectedTypeParameters: function(resolve, reject) {
+ }
+ testSetDigestCredentialsWithUnexpectedTypeParameters(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.setDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testSetDigestCredentialsWithExcessiveParametersNumber: function(resolve, reject) {
+ }
+ testSetDigestCredentialsWithExcessiveParametersNumber(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.setDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testClearDigestCredentials: function(resolve, reject) {
+ }
+ testClearDigestCredentials(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.clearDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testClearDigestCredentialsWithoutParameters: function(resolve, reject) {
+ }
+ testClearDigestCredentialsWithoutParameters(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.clearDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testClearDigestCredentialsWithUnexpectedTypeParameters: function(resolve, reject) {
+ }
+ testClearDigestCredentialsWithUnexpectedTypeParameters(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.clearDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testClearDigestCredentialsWithExcessiveParametersNumber: function(resolve, reject) {
+ }
+ testClearDigestCredentialsWithExcessiveParametersNumber(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.clearDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testHasDigestCredentials: function(resolve, reject) {
-
+ }
+
+ testHasDigestCredentials(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.hasDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testHasDigestCredentialsWithoutParameters: function(resolve, reject) {
-
+ }
+
+ testHasDigestCredentialsWithoutParameters(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.hasDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testHasDigestCredentials: function(resolve, reject) {
-
+ }
+
+ testHasDigestCredentials(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.hasDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- testHasDigestCredentialsWithExcessiveParametersNumber: function(resolve, reject) {
-
+ }
+
+ testHasDigestCredentialsWithExcessiveParametersNumber(resolve, reject) {
+
if (this.localSystem) {
this.localSystem.hasDigestCredentials(640, 480, 854);
} else {
throw new Error("Unexpected error");
}
- },
-
- afterTest: function() {
}
-
-});
+ afterTest() {
+ }
+
+}
+
Modified: oipf/test/js/OipfFactoryTest.js
===================================================================
--- oipf/test/js/OipfFactoryTest.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/OipfFactoryTest.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -1,12 +1,13 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var OipfFactoryTest = TestCase.extend({
- init: function() {
- this.testIsApplicationManagerObjectSupported = this.testObjectSupported.bind(this, APPLICATION_MANAGER_DAE_MIME_TYPE);
+class OipfFactoryTest extends TestCase {
+ constructor() {
+ this.testIsApplicationManagerObjectSupported =
+ this.testObjectSupported.bind(this, APPLICATION_MANAGER_DAE_MIME_TYPE);
this.testIsCapabilitiesObjectSupported = this.testObjectSupported.bind(this, CAPABILITIES_DAE_MIME_TYPE);
this.testIsChannelConfigSupported = this.testObjectSupported.bind(this, CHANNEL_CONFIG_TYPE);
this.testIsCodManagerObjectSupported = this.testObjectSupported.bind(this, COD_MANAGER_DAE_MIME_TYPE);
@@ -18,38 +19,51 @@
this.testIsGatewayInfoObjectSupported = this.testObjectSupported.bind(this, GATEWAY_INFO_DAE_MIME_TYPE);
this.testIsMDTFObjectSupported = this.testObjectSupported.bind(this, MDTF_DAE_MIME_TYPE);
this.testIsNotifSocketObjectSupported = this.testObjectSupported.bind(this, NOTIF_SOCKET_DAE_MIME_TYPE);
- this.testIsParentalControlManagerObjectSupported = this.testObjectSupported.bind(this, PARENTAL_CONTROL_MANAGER_DAE_MIME_TYPE);
- this.testIsRecordingSchedulerObjectSupported = this.testObjectSupported.bind(this, RECORDING_SCHEDULER_DAE_MIME_TYPE);
- this.testIsRemoteControlFunctionObjectSupported = this.testObjectSupported.bind(this, REMOTE_CONTROL_FUNCTION_DAE_MIME_TYPE);
+ this.testIsParentalControlManagerObjectSupported =
+ this.testObjectSupported.bind(this, PARENTAL_CONTROL_MANAGER_DAE_MIME_TYPE);
+ this.testIsRecordingSchedulerObjectSupported =
+ this.testObjectSupported.bind(this, RECORDING_SCHEDULER_DAE_MIME_TYPE);
+ this.testIsRemoteControlFunctionObjectSupported =
+ this.testObjectSupported.bind(this, REMOTE_CONTROL_FUNCTION_DAE_MIME_TYPE);
this.testIsRemoteManagementObjectSupported = this.testObjectSupported.bind(this, REMOTE_MANAGEMENT_DAE_MIME_TYPE);
this.testIsSearchManagerObjectSupported = this.testObjectSupported.bind(this, SEARCH_MANAGER_DAE_MIME_TYPE);
this.testIsStatusViewObjectSupported = this.testObjectSupported.bind(this, STATUS_VIEW_DAE_MIME_TYPE);
this.testIsVideoBroadcastObjectSupported = this.testObjectSupported.bind(this, VIDEO_BROADCAST_DAE_MIME_TYPE);
this.testIsVideoMpegObjectSupported = this.testObjectSupported.bind(this, VIDEO_MPEG_DAE_MIME_TYPE);
-
- this.testCreateApplicationManagerObject = this.testObjectCreated.bind(this, oipfObjectFactory.createApplicationManagerObject);
- this.testCreateCapabilitiesObject = this.testObjectCreated.bind(this, oipfObjectFactory.createCapabilitiesObject);
+
+ this.testCreateApplicationManagerObject =
+ this.testObjectCreated.bind(this, oipfObjectFactory.createApplicationManagerObject);
+ this.testCreateCapabilitiesObject = this.testObjectCreated.bind(this, oipfObjectFactory.createCapabilitiesObject);
this.testCreateChannelConfig = this.testObjectCreated.bind(this, oipfObjectFactory.createChannelConfig);
this.testCreateCodManagerObject = this.testObjectCreated.bind(this, oipfObjectFactory.createCodManagerObject);
- this.testCreateConfigurationObject = this.testObjectCreated.bind(this, oipfObjectFactory.createConfigurationObject);
- this.testCreateDownloadManagerObject = this.testObjectCreated.bind(this, oipfObjectFactory.createDownloadManagerObject);
- this.testCreateDownloadTriggerObject = this.testObjectCreated.bind(this, oipfObjectFactory.createDownloadTriggerObject);
+ this.testCreateConfigurationObject =
+ this.testObjectCreated.bind(this, oipfObjectFactory.createConfigurationObject);
+ this.testCreateDownloadManagerObject =
+ this.testObjectCreated.bind(this, oipfObjectFactory.createDownloadManagerObject);
+ this.testCreateDownloadTriggerObject =
+ this.testObjectCreated.bind(this, oipfObjectFactory.createDownloadTriggerObject);
this.testCreateDrmAgentObject = this.testObjectCreated.bind(this, oipfObjectFactory.createDrmAgentObject);
this.testCreateGatewayInfoObject = this.testObjectCreated.bind(this, oipfObjectFactory.createGatewayInfoObject);
this.testCreateIMSObject = this.testObjectCreated.bind(this, oipfObjectFactory.createIMSObject);
this.testCreateMDTFObject = this.testObjectCreated.bind(this, oipfObjectFactory.createMDTFObject);
this.testCreateNotifSocketObject = this.testObjectCreated.bind(this, oipfObjectFactory.createNotifSocketObject);
- this.testCreateParentalControlManagerObject = this.testObjectCreated.bind(this, oipfObjectFactory.createParentalControlManagerObject);
- this.testCreateRecordingSchedulerObject = this.testObjectCreated.bind(this, oipfObjectFactory.createRecordingSchedulerObject);
- this.testCreateRemoteControlFunctionObject = this.testObjectCreated.bind(this, oipfObjectFactory.createRemoteControlFunctionObject);
- this.testCreateRemoteManagementObject = this.testObjectCreated.bind(this, oipfObjectFactory.createRemoteManagementObject);
- this.testCreateSearchManagerObject = this.testObjectCreated.bind(this, oipfObjectFactory.createSearchManagerObject);
+ this.testCreateParentalControlManagerObject =
+ this.testObjectCreated.bind(this, oipfObjectFactory.createParentalControlManagerObject);
+ this.testCreateRecordingSchedulerObject =
+ this.testObjectCreated.bind(this, oipfObjectFactory.createRecordingSchedulerObject);
+ this.testCreateRemoteControlFunctionObject =
+ this.testObjectCreated.bind(this, oipfObjectFactory.createRemoteControlFunctionObject);
+ this.testCreateRemoteManagementObject =
+ this.testObjectCreated.bind(this, oipfObjectFactory.createRemoteManagementObject);
+ this.testCreateSearchManagerObject =
+ this.testObjectCreated.bind(this, oipfObjectFactory.createSearchManagerObject);
this.testCreateStatusViewObject = this.testObjectCreated.bind(this, oipfObjectFactory.createStatusViewObject);
- this.testCreateVideoBroadcastObject = this.testObjectCreated.bind(this, oipfObjectFactory.createVideoBroadcastObject);
+ this.testCreateVideoBroadcastObject =
+ this.testObjectCreated.bind(this, oipfObjectFactory.createVideoBroadcastObject);
this.testCreateVideoMpegObject = this.testObjectCreated.bind(this, oipfObjectFactory.createVideoMpegObject);
- },
-
- testObjectCreated: function(method, resolve, reject) {
+ }
+
+ testObjectCreated(method, resolve, reject) {
var object = method.call(oipfObjectFactory);
if (this.assertNotNull(object)) {
@@ -57,13 +71,13 @@
} else {
reject("The object is null.");
}
- },
-
- testObjectSupported: function(mimeType, resolve, reject) {
+ }
+
+ testObjectSupported(mimeType, resolve, reject) {
if (oipfObjectFactory.isObjectSupported(mimeType)) {
resolve();
} else {
reject();
}
}
-});
+}
Modified: oipf/test/js/ParentalControlManagerTest.js
===================================================================
--- oipf/test/js/ParentalControlManagerTest.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/ParentalControlManagerTest.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -1,279 +1,278 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var ParentalControlManagerTest = TestCase.extend({
-
- init: function() {
- this.super.init();
+class ParentalControlManagerTest extends TestCase {
+
+ constructor() {
+ super();
this.PIN_CORRECT = 0;
this.PIN_INCORRECT = 1;
this.PIN_LOCKED = 2;
this.PIN = "1234";
- },
-
- beforeTest: function(resolve, reject) {
- this.parentalControlManagerObject =
+ }
+
+ beforeTest(resolve, reject) {
+ this.parentalControlManagerObject =
oipfObjectFactory.createParentalControlManagerObject();
-
- },
-
- afterTest: function() {
+ }
+
+ afterTest() {
this.parentalControlManagerObject.setParentalControlStatus(this.PIN, false);
this.parentalControlManagerObject.setBlockUnrated(this.PIN, false);
this.parentalControlManagerObject._setCurrentInvalidPINAttempts &&
this.parentalControlManagerObject._setCurrentInvalidPINAttempts(0);
-
+
this.newPIN && this.resetOldPIN();
- },
-
- resetOldPIN: function() {
+ }
+
+ resetOldPIN() {
this.parentalControlManagerObject
.setParentalControlPIN(this.newPIN, this.PIN);
- },
-
- renderResultIfTrue: function(resolve, reject, condition) {
+ }
+
+ renderResultIfTrue(resolve, reject, condition) {
if (condition) {
resolve();
} else {
reject();
}
- },
-
- testSetParentalControlStatusWithValidPINAndTrue: function(resolve, reject) {
+ }
+
+ testSetParentalControlStatusWithValidPINAndTrue(resolve, reject) {
var result = this.parentalControlManagerObject
.setParentalControlStatus(this.PIN, true);
-
- console.log(result);
-
+
+ console.log(result);
+
if (this.assertEquals(result, 0)) {
resolve();
} else {
reject();
}
- },
-
- testSetParentalControlStatusWithValidPINAndFalse: function(resolve, reject) {
+ }
+
+ testSetParentalControlStatusWithValidPINAndFalse(resolve, reject) {
var result = this.parentalControlManagerObject
.setParentalControlStatus(this.PIN, false);
-
- console.log(result);
-
+
+ console.log(result);
+
if (this.assertEquals(result, 0)) {
resolve();
} else {
reject();
}
- },
-
- testSetParentalControlStatusWithInvalidPINAndTrue: function(resolve, reject) {
+ }
+
+ testSetParentalControlStatusWithInvalidPINAndTrue(resolve, reject) {
var result = this.parentalControlManagerObject
.setParentalControlStatus("5555", true);
-
- console.log(result);
-
+
+ console.log(result);
+
this.renderResultIfTrue(resolve, reject, this.assertEquals(result, 1));
- },
+ }
- testSetParentalControlStatusWithInvalidPINAndFalse: function(resolve, reject) {
+ testSetParentalControlStatusWithInvalidPINAndFalse(resolve, reject) {
var result = this.parentalControlManagerObject
.setParentalControlStatus("5555", false);
-
- console.log(result);
-
+
+ console.log(result);
+
this.renderResultIfTrue(resolve, reject, this.assertEquals(result, 1));
- },
-
- testSetParentalControlStatusWithInvalidOldPINAndValidNewPIN10Times: function(resolve, reject) {
- for(var i = 0, li = 10; i < li; i++) {
+ }
+
+ testSetParentalControlStatusWithInvalidOldPINAndValidNewPIN10Times(resolve, reject) {
+ for (var i = 0, li = 10; i < li; i++) {
var result = this.parentalControlManagerObject
.setParentalControlStatus("PIN", false);
-
- console.log(i+1, ":", result);
+
+ console.log(i + 1, ":", result);
}
-
- this.renderResultIfTrue(resolve, reject,
+
+ this.renderResultIfTrue(resolve, reject,
this.assertEquals(result, this.PIN_LOCKED));
- },
-
- testVerifyParentalControlPINWithInvalidPIN10Times: function(resolve, reject) {
- for(var i = 0, li = 10; i < li; i++) {
+ }
+
+ testVerifyParentalControlPINWithInvalidPIN10Times(resolve, reject) {
+ for (var i = 0, li = 10; i < li; i++) {
var result = this.parentalControlManagerObject
.verifyParentalControlPIN("0000");
-
- console.log(i+1, ":", result);
+
+ console.log(i + 1, ":", result);
}
-
+
if (this.assertEquals(result, 2)) {
resolve();
} else {
reject();
}
- },
+ }
- testVerifyParentalControlPINWithValidPIN: function(resolve, reject) {
+ testVerifyParentalControlPINWithValidPIN(resolve, reject) {
var result = this.parentalControlManagerObject
.verifyParentalControlPIN("1234");
- console.log(result);
-
- this.renderResultIfTrue(resolve, reject,
+ console.log(result);
+
+ this.renderResultIfTrue(resolve, reject,
this.assertEquals(result, this.PIN_CORRECT));
- },
-
- testVerifyParentalControlPINWithInvalidPIN: function(resolve, reject) {
+ }
+
+ testVerifyParentalControlPINWithInvalidPIN(resolve, reject) {
var result = this.parentalControlManagerObject
.verifyParentalControlPIN("68465");
- console.log(result);
-
- this.renderResultIfTrue(resolve, reject,
+ console.log(result);
+
+ this.renderResultIfTrue(resolve, reject,
this.assertEquals(result, this.PIN_INCORRECT));
- },
+ }
- testSetBlockUnratedWithInvalidPIN10Times: function(resolve, reject) {
- for(var i = 0, li = 10; i < li; i++) {
+ testSetBlockUnratedWithInvalidPIN10Times(resolve, reject) {
+ for (var i = 0, li = 10; i < li; i++) {
var result = this.parentalControlManagerObject
.setBlockUnrated("toto", true);
-
- console.log(i+1, ":", result);
+
+ console.log(i + 1, ":", result);
}
-
+
if (this.assertEquals(result, 2)) {
resolve();
} else {
reject();
}
- },
-
- testSetBlockUnratedWithValidPINAndTrue: function(resolve, reject) {
+ }
+
+ testSetBlockUnratedWithValidPINAndTrue(resolve, reject) {
var result = this.parentalControlManagerObject
.setBlockUnrated(this.PIN, true);
-
- console.log(result);
-
+
+ console.log(result);
+
if (this.assertEquals(result, 0)) {
resolve();
} else {
reject();
}
- },
+ }
- testSetBlockUnratedWithValidPINAndFalse: function(resolve, reject) {
+ testSetBlockUnratedWithValidPINAndFalse(resolve, reject) {
var result = this.parentalControlManagerObject
.setBlockUnrated(this.PIN, false);
-
- console.log(result);
-
+
+ console.log(result);
+
if (this.assertEquals(result, 0)) {
resolve();
} else {
reject();
}
- },
-
- testSetBlockUnratedWithInvalidPINAndTrue: function(resolve, reject) {
+ }
+
+ testSetBlockUnratedWithInvalidPINAndTrue(resolve, reject) {
var result = this.parentalControlManagerObject
.setBlockUnrated("5555", true);
-
- console.log(result);
-
+
+ console.log(result);
+
this.renderResultIfTrue(resolve, reject, this.assertEquals(result, 1));
- },
+ }
- testSetBlockUnratedWithInvalidPINAndFalse: function(resolve, reject) {
+ testSetBlockUnratedWithInvalidPINAndFalse(resolve, reject) {
var result = this.parentalControlManagerObject
.setBlockUnrated("5555", false);
-
- console.log(result);
-
+
+ console.log(result);
+
this.renderResultIfTrue(resolve, reject, this.assertEquals(result, 1));
- },
-
- testGetBlockUnratedWhenUnratedContentsAreNotBlocked: function(resolve, reject) {
+ }
+
+ testGetBlockUnratedWhenUnratedContentsAreNotBlocked(resolve, reject) {
if (!this.parentalControlManagerObject.getBlockUnrated()) {
resolve();
} else {
reject();
}
- },
-
- testGetBlockUnratedWhenUnratedContentsAreBlocked: function(resolve, reject) {
+ }
+
+ testGetBlockUnratedWhenUnratedContentsAreBlocked(resolve, reject) {
this.parentalControlManagerObject.setBlockUnrated("1234", true);
-
+
if (this.parentalControlManagerObject.getBlockUnrated()) {
resolve();
} else {
reject();
}
- },
-
- testSetParentalControlPINWithInvalidOldPINAndValidNewPIN10Times: function(resolve, reject) {
- for(var i = 0, li = 10; i < li; i++) {
+ }
+
+ testSetParentalControlPINWithInvalidOldPINAndValidNewPIN10Times(resolve, reject) {
+ for (var i = 0, li = 10; i < li; i++) {
var resultSetPIN = this.parentalControlManagerObject
.setParentalControlPIN("PIN", "1212");
-
- console.log(i+1, ":", resultSetPIN);
+
+ console.log(i + 1, ":", resultSetPIN);
}
-
- this.renderResultIfTrue(resolve, reject,
+
+ this.renderResultIfTrue(resolve, reject,
this.assertEquals(resultSetPIN, this.PIN_LOCKED));
- },
-
- testSetParentalControlPINWithValidOldPINAndNewPIN: function(resolve, reject) {
+ }
+
+ testSetParentalControlPINWithValidOldPINAndNewPIN(resolve, reject) {
this.newPIN = "1212";
var resultSetPIN = this.parentalControlManagerObject
.setParentalControlPIN(this.PIN, this.newPIN);
-
+
var resultVerifyPIN = this.parentalControlManagerObject
.verifyParentalControlPIN(this.newPIN);
-
- if (this.assertEquals(resultSetPIN, this.PIN_CORRECT) &&
+
+ if (this.assertEquals(resultSetPIN, this.PIN_CORRECT) &&
this.assertEquals(resultVerifyPIN, this.PIN_CORRECT)) {
resolve();
} else {
reject();
}
- },
-
- testSetParentalControlPINWithInvalidOldPINAndValidNewPIN: function(resolve, reject) {
+ }
+
+ testSetParentalControlPINWithInvalidOldPINAndValidNewPIN(resolve, reject) {
this.newPIN = "1212";
var resultSetPIN = this.parentalControlManagerObject
.setParentalControlPIN("PIN", this.newPIN);
-
+
console.log(resultSetPIN);
-
+
var resultVerifyPIN = this.parentalControlManagerObject
.verifyParentalControlPIN(this.newPIN);
console.log(resultVerifyPIN);
-
- if (this.assertEquals(resultSetPIN, this.PIN_INCORRECT) &&
+
+ if (this.assertEquals(resultSetPIN, this.PIN_INCORRECT) &&
this.assertEquals(resultVerifyPIN, this.PIN_INCORRECT)) {
resolve();
} else {
reject();
}
- },
-
- testGetParentalControlStatusWhenParentalControlStatusDeactivated: function(resolve, reject) {
+ }
+
+ testGetParentalControlStatusWhenParentalControlStatusDeactivated(resolve, reject) {
if (!this.parentalControlManagerObject.getParentalControlStatus()) {
resolve();
} else {
reject();
}
- },
-
- testGetParentalControlStatusWhenParentalControlStatusActivated: function(resolve, reject) {
+ }
+
+ testGetParentalControlStatusWhenParentalControlStatusActivated(resolve, reject) {
this.parentalControlManagerObject
.setParentalControlStatus(this.PIN, true);
-
+
if (this.parentalControlManagerObject.getParentalControlStatus()) {
resolve();
} else {
reject();
}
}
-});
\ No newline at end of file
+}
Modified: oipf/test/js/RecordingSchedulerTest.js
===================================================================
--- oipf/test/js/RecordingSchedulerTest.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/RecordingSchedulerTest.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -1,23 +1,23 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var RecordingSchedulerTest = TestCase.extend({
-
- init: function() {
- this.super.init();
- this.timer = 3*60*1000; //3minutes, we had increased timer for unresolved tests.
- },
-
- createVideoBroadcast: function() {
+class RecordingSchedulerTest extends TestCase {
+
+ constructor() {
+ super();
+ this.timer = 3 * 60 * 1000; //3minutes, we had increased timer for unresolved tests.
+ }
+
+ createVideoBroadcast() {
this.vidBroadObj = oipfObjectFactory.createVideoBroadcastObject();
- },
-
- deleteAndStopStartedRecording: function() {
+ }
+
+ deleteAndStopStartedRecording() {
var recordings = this.recordingSchedulerObject.recordings;
-
+
for (var i = 0, l = recordings.length; i < l; i++) {
var recording = recordings[i];
if (recording.state == this.STARTED) {
@@ -25,45 +25,45 @@
this.recordingSchedulerObject.remove(recording);
}
}
- },
-
- beforeTest: function(resolve, reject) {
+ }
+
+ beforeTest(resolve, reject) {
var self = this;
- this.getPromise = function () {
+ this.getPromise = function() {
return new Promise(function(resolve, reject) {
self.resolve = resolve;
resolve();
});
};
this.onPVREventCopy = this.onPVREvent.bind(this, resolve, reject);
- this.recordingSchedulerObject =
+ this.recordingSchedulerObject =
oipfObjectFactory.createRecordingSchedulerObject();
this.recordingSchedulerObject
.addEventListener("PVREvent", this.onPVREventCopy, false);
-
+
this.createVideoBroadcast();
this.onPlayStateChange = this.onChangeState.bind(this, resolve, reject);
this.vidBroadObj
.addEventListener("PlayStateChange", this.onPlayStateChange, false);
-
+
this.deleteAndStopStartedRecording();
-
+
this.searchManagerObj = oipfObjectFactory.createSearchManagerObject();
-
+
this.transitions = [];
this.previousState = null;
this.currentIndex = 0;
- },
-
- afterTest: function(resolve, reject) {
+ }
+
+ afterTest(resolve, reject) {
this.recordingSchedulerObject
.removeEventListener("PVREvent", this.onPVREventCopy);
this.recordingSchedulerObject.stop(this.recording);
this.recordingSchedulerObject.remove(this.recording);
- },
-
- onPVREvent: function(resolve, reject, newState, recordings) {
+ }
+
+ onPVREvent(resolve, reject, newState, recordings) {
if (this.currentIndex < this.transitions.length) {
console.log("PVREvent received: State:", newState);
var currentTransition = this.transitions[this.currentIndex];
@@ -80,11 +80,11 @@
} else {
console.log("Any others transitions have been set.");
}
- },
-
- testRecordAFinishedProgramme: function(resolve, reject) {
+ }
+
+ testRecordAFinishedProgramme(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -98,11 +98,11 @@
reject();
}
});
- },
-
- testRecordCurrentProgramme: function(resolve, reject) {
+ }
+
+ testRecordCurrentProgramme(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -115,31 +115,31 @@
self.addTransition(self.SCHEDULED, self.BEFORE_STARTED);
self.addTransition(self.BEFORE_STARTED, self.STARTED);
self.addTransition(self.STARTED, self.COMPLETED, resolve);
-
+
self.recording = self.recordingSchedulerObject.record(self.programme);
console.log("Recording State after scheduling:", self.recording.state);
// console.log("Recording:", self.recording);
});
- },
-
- testRecordAtCurrentProgramme: function(resolve, reject) {
+ }
+
+ testRecordAtCurrentProgramme(resolve, reject) {
this.addTransition(null, this.SCHEDULED);
this.addTransition(this.SCHEDULED, this.BEFORE_STARTED);
this.addTransition(this.BEFORE_STARTED, this.STARTED);
this.addTransition(this.STARTED, this.COMPLETED, resolve);
var channelConfig = this.vidBroadObj.getChannelConfig();
- var randomIndex = oipf.utils
+ var randomIndex = OipfUtils
.getRandomNumberBetweenMinMax(0, channelConfig.channelList.length);
var channel = channelConfig.channelList[randomIndex];
var currentTime = Math.round(this.dateUtils.nowInSeconds());
- this.recording = this.recordingSchedulerObject.recordAt(currentTime,
- 1*60, 0x00, channel.ccid);
+ this.recording = this.recordingSchedulerObject.recordAt(currentTime,
+ 1 * 60, 0x00, channel.ccid);
console.log(this.recording);
- },
-
- testStopAScheduledRecording: function(resolve, reject) {
+ }
+
+ testStopAScheduledRecording(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -151,14 +151,14 @@
self.recordingSchedulerObject.stop(self.recording);
self.timeout(2000).then(resolve);
});
-
+
self.recording = self.recordingSchedulerObject.record(self.programme);
});
- },
-
- testStopAnOngoingRecording: function(resolve, reject) {
+ }
+
+ testStopAnOngoingRecording(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -172,14 +172,14 @@
self.recordingSchedulerObject.stop(self.recording);
self.timeout(2000).then(resolve);
});
-
+
self.recording = self.recordingSchedulerObject.record(self.programme);
});
- },
-
- testStopACompletedRecording: function(resolve, reject) {
+ }
+
+ testStopACompletedRecording(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -194,14 +194,14 @@
self.recordingSchedulerObject.stop(self.recording);
self.timeout(3000).then(resolve);
});
-
+
self.recording = self.recordingSchedulerObject.record(self.programme);
});
- },
-
- testRemoveAScheduledRecording: function(resolve, reject) {
+ }
+
+ testRemoveAScheduledRecording(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -209,19 +209,19 @@
.then(this.timeout.bind(this))
.then(function() {
self.resetTransitionVariables();
- self.addTransition(null, self.SCHEDULED, function () {
+ self.addTransition(null, self.SCHEDULED, function() {
self.recordingSchedulerObject.remove(self.recording);
});
self.addTransition(self.SCHEDULED, self.REMOVED, resolve);
-
+
self.recording = self.recordingSchedulerObject
.record(self.programme);
});
- },
-
- testRemoveAnOngoingRecording: function(resolve, reject) {
+ }
+
+ testRemoveAnOngoingRecording(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -235,15 +235,15 @@
self.recordingSchedulerObject.remove(self.recording);
});
self.addTransition(self.STARTED, self.REMOVED, resolve);
-
+
self.recording = self.recordingSchedulerObject
.record(self.programme);
});
- },
-
- testRemoveACompletedRecording: function(resolve, reject) {
+ }
+
+ testRemoveACompletedRecording(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -254,17 +254,17 @@
self.addTransition(null, self.SCHEDULED);
self.addTransition(self.SCHEDULED, self.BEFORE_STARTED);
self.addTransition(self.BEFORE_STARTED, self.STARTED);
- self.addTransition(self.STARTED, self.COMPLETED, function () {
+ self.addTransition(self.STARTED, self.COMPLETED, function() {
self.recordingSchedulerObject.remove(self.recording);
});
self.addTransition(self.COMPLETED, self.REMOVED, resolve);
self.recording = self.recordingSchedulerObject.record(self.programme);
});
- },
-
- testUpdateAScheduledRecordingOnStartTime: function(resolve, reject) {
+ }
+
+ testUpdateAScheduledRecordingOnStartTime(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -272,7 +272,7 @@
.then(this.timeout.bind(this))
.then(function() {
self.resetTransitionVariables();
- self.addTransition(null, self.SCHEDULED, function () {
+ self.addTransition(null, self.SCHEDULED, function() {
var twentyMinutes = 20 * 60;
self.recordingSchedulerObject.update(self.recording.id,
self.recording.startTime + twentyMinutes, undefined,
@@ -283,11 +283,11 @@
self.addTransition(self.STARTED, self.COMPLETED);
self.recording = self.recordingSchedulerObject.record(self.programme);
});
- },
-
- testUpdateAScheduledRecordingOnDuration: function(resolve, reject) {
+ }
+
+ testUpdateAScheduledRecordingOnDuration(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -295,7 +295,7 @@
.then(this.timeout.bind(this))
.then(function() {
self.resetTransitionVariables();
- self.addTransition(null, self.SCHEDULED, function () {
+ self.addTransition(null, self.SCHEDULED, function() {
var twentyMinutes = 20 * 60;
self.recordingSchedulerObject.update(self.recording.id,
undefined, self.recording.duration + twentyMinutes,
@@ -306,11 +306,11 @@
self.addTransition(self.STARTED, self.COMPLETED);
self.recording = self.recordingSchedulerObject.record(self.programme);
});
- },
-
- testUpdateAnOngoingRecordingWithAValidDuration: function(resolve, reject) {
+ }
+
+ testUpdateAnOngoingRecordingWithAValidDuration(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -320,7 +320,7 @@
self.resetTransitionVariables();
self.addTransition(null, self.SCHEDULED);
self.addTransition(self.SCHEDULED, self.BEFORE_STARTED);
- self.addTransition(self.BEFORE_STARTED, self.STARTED, function () {
+ self.addTransition(self.BEFORE_STARTED, self.STARTED, function() {
var oneMinute = 1 * 60;
var result = self.recordingSchedulerObject.update(self.recording.id,
undefined, self.recording.duration + oneMinute,
@@ -334,11 +334,11 @@
self.recording = self.recordingSchedulerObject
.record(self.programme);
});
- },
-
- testUpdateAnOngoingRecordingWithATooShortDuration: function(resolve, reject) {
+ }
+
+ testUpdateAnOngoingRecordingWithATooShortDuration(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -348,7 +348,7 @@
self.resetTransitionVariables();
self.addTransition(null, self.SCHEDULED);
self.addTransition(self.SCHEDULED, self.BEFORE_STARTED);
- self.addTransition(self.BEFORE_STARTED, self.STARTED, function () {
+ self.addTransition(self.BEFORE_STARTED, self.STARTED, function() {
var oneMinute = 1 * 60;
var result = self.recordingSchedulerObject.update(
self.recording.id, undefined, oneMinute, undefined);
@@ -361,11 +361,11 @@
self.recording = self.recordingSchedulerObject
.record(self.programme);
});
- },
-
- testUpdateAnOngoingRecordingOnStartTime: function(resolve, reject) {
+ }
+
+ testUpdateAnOngoingRecordingOnStartTime(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -375,8 +375,8 @@
self.resetTransitionVariables();
self.addTransition(null, self.SCHEDULED);
self.addTransition(self.SCHEDULED, self.BEFORE_STARTED);
- self.addTransition(self.BEFORE_STARTED, self.STARTED, function () {
-
+ self.addTransition(self.BEFORE_STARTED, self.STARTED, function() {
+
var result = self.recordingSchedulerObject.update(self.recording.id,
564, undefined, undefined);
if (self.assertEquals(result, false)) {
@@ -388,12 +388,12 @@
self.recording = self.recordingSchedulerObject
.record(self.programme);
});
- },
-
-
- testUpdateAnOngoingRecordingOnRepeatDays: function(resolve, reject) {
+ }
+
+
+ testUpdateAnOngoingRecordingOnRepeatDays(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -403,10 +403,10 @@
self.resetTransitionVariables();
self.addTransition(null, self.SCHEDULED);
self.addTransition(self.SCHEDULED, self.BEFORE_STARTED);
- self.addTransition(self.BEFORE_STARTED, self.STARTED, function () {
+ self.addTransition(self.BEFORE_STARTED, self.STARTED, function() {
var result = self.recordingSchedulerObject.update(
self.recording.id, undefined, undefined, 0x00);
-
+
if (self.assertEquals(result, false)) {
resolve();
} else {
@@ -416,11 +416,11 @@
self.recording = self.recordingSchedulerObject
.record(self.programme);
});
- },
-
- testUpdateACompletedRecordingOnDuration: function(resolve, reject) {
+ }
+
+ testUpdateACompletedRecordingOnDuration(resolve, reject) {
var self = this;
-
+
this.getPromise()
.then(this.bindToCurrentChannel.bind(this))
.then(this.timeout.bind(this))
@@ -431,36 +431,36 @@
self.addTransition(null, self.SCHEDULED);
self.addTransition(self.SCHEDULED, self.BEFORE_STARTED);
self.addTransition(self.BEFORE_STARTED, self.STARTED);
- self.addTransition(self.STARTED, self.COMPLETED, function () {
+ self.addTransition(self.STARTED, self.COMPLETED, function() {
var twentyMinutes = 20 * 60;
var result = self.recordingSchedulerObject
- .update(self.recording.id, undefined,
+ .update(self.recording.id, undefined,
self.recording.duration + twentyMinutes,
undefined);
-
+
if (self.assertEquals(result, false)) {
resolve();
} else {
reject();
}
});
-
+
self.recording = self.recordingSchedulerObject
.record(self.programme);
});
- },
-
- bindToCurrentChannel: function() {
+ }
+
+ bindToCurrentChannel() {
this.previousState = this.UNREALIZED;
this.addTransition(this.UNREALIZED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
console.log("Binding with current channel succeeded.");
});
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- findAFinishedProgramme: function() {
+ }
+
+ findAFinishedProgramme() {
var self = this;
var metadataSearch = self.searchManagerObj.
createSearch(self.SCHEDULED_CONTENT);
@@ -471,9 +471,9 @@
var offset = 0;
var count = 4;
metadataSearch.result.getResults(offset, count);
-
+
this.searchManagerObj.onMetadataSearch = function(search, state) {
-
+
console.log("[INFO]: onMetadataSearch called");
switch (state) {
@@ -493,9 +493,9 @@
reject();
}
};
- },
-
- findProgrammeFromStream: function() {
+ }
+
+ findProgrammeFromStream() {
var searchTarget = 1;
var metaDataSearch = this.searchManagerObj.createSearch(searchTarget);
var currentChannel = this.vidBroadObj.currentChannel;
@@ -506,7 +506,7 @@
metaDataSearch.result.getResults(offset, count);
var self = this;
this.searchManagerObj.onMetadataSearch = function(search, state) {
-
+
console.log("[INFO]: onMetadataSearch called");
switch (state) {
@@ -525,13 +525,13 @@
console.log("Unknow state");
}
};
- },
-
- resetTransitionVariables: function() {
+ }
+
+ resetTransitionVariables() {
this.currentIndex = 0;
this.transitions = [];
this.previousState = null;
}
-});
+}
Modified: oipf/test/js/SearchManagerTest.js
===================================================================
--- oipf/test/js/SearchManagerTest.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/SearchManagerTest.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -1,25 +1,16 @@
-/*
+/*
* Description:
* This class gather a set of method necessary to test a search manager object.
- *
+ *
*/
-var SearchManagerTest = TestCase.extend({
-
- UNREALIZED: 0,
-
- CONNECTING: 1,
-
- PRESENTING: 2,
-
- STOPPED: 3,
-
- searchManagerObj: null,
-
- init: function() {
- this.super.init();
- },
-
- beforeTest: function(resolve, reject) {
+class SearchManagerTest extends TestCase {
+
+ constructor() {
+ super();
+ this.searchManagerObj = null;
+ }
+
+ beforeTest(resolve, reject) {
this.searchManagerObj = oipfObjectFactory.createSearchManagerObject();
this.vidBroadObj = oipfObjectFactory.createVideoBroadcastObject();
this.onPlayStateChange = this.onChangeState.bind(this, resolve, reject);
@@ -28,18 +19,18 @@
this.previousState = this.vidBroadObj.playState;
this.currentIndex = 0;
this.channel = null;
- logTest("State: Pending");
- },
-
- afterTest: function(resolve, reject) {
- this.vidBroadObj.removeEventListener("PlayStateChange",
+ OipfUtils.logTest("State: Pending");
+ }
+
+ afterTest(resolve, reject) {
+ this.vidBroadObj.removeEventListener("PlayStateChange",
this.onPlayStateChange);
this.searchManagerObj.removeEventListener("MetadataSearch",
this.onPlayStateChange);
this.timerManager.clearTimer();
- },
-
- testFindAFinishedProgramme: function(resolve, reject) {
+ }
+
+ testFindAFinishedProgramme(resolve, reject) {
var self = this;
var metadataSearch = self.searchManagerObj.
createSearch(self.SCHEDULED_CONTENT);
@@ -50,9 +41,9 @@
var offset = 0;
var count = 4;
metadataSearch.result.getResults(offset, count);
-
+
this.searchManagerObj.onMetadataSearch = function(search, state) {
-
+
console.log("[INFO]: onMetadataSearch called");
switch (state) {
@@ -72,18 +63,18 @@
reject();
}
};
-
- },
-
- testGetCurrentProgrammeFromStream: function (resolve, reject) {
+
+ }
+
+ testGetCurrentProgrammeFromStream(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
-
+
var stat = "Pending";
- logTest("State: " + stat);
+ OipfUtils.logTest("State: " + stat);
var searchTarget = 1;
var metaDataSearch = self.searchManagerObj.createSearch(searchTarget);
var currentChannel = self.vidBroadObj.currentChannel;
@@ -94,9 +85,9 @@
metaDataSearch.result.getResults(offset, count);
// console.log(metaDataSearch.result[0]);//Must return undefined else wrong implementation of getResults method
});
-
+
this.searchManagerObj.onMetadataSearch = function(search, state) {
-
+
console.log("[INFO]: onMetadataSearch called");
switch (state) {
@@ -129,16 +120,16 @@
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testSearchingForASpecificProgrammeByName: function(resolve, reject) {
+ }
+
+ testSearchingForASpecificProgrammeByName(resolve, reject) {
var self = this;
var value = "X:enius";
-
+
var stat = "Pending";
- logTest("State: " + stat);
+ OipfUtils.logTest("State: " + stat);
var metadataSearch = self.searchManagerObj.
createSearch(self.SCHEDULED_CONTENT);
@@ -148,9 +139,9 @@
var offset = 0;
var count = 1;
metadataSearch.result.getResults(offset, count);
-
+
this.searchManagerObj.onMetadataSearch = function(search, state) {
-
+
console.log("[INFO]: onMetadataSearch called");
switch (state) {
@@ -184,37 +175,37 @@
}
};
-
+
// this.vidBroadObj.bindToCurrentChannel();
-
- },
-
- testSearchingForProgrammesWithDurationLowerThanOneHour: function(resolve, reject) {
+
+ }
+
+ testSearchingForProgrammesWithDurationLowerThanOneHour(resolve, reject) {
var self = this;
var value = 3600;
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
-
+
var stat = "Pending";
- logTest("State: " + stat);
+ OipfUtils.logTest("State: " + stat);
var metadataSearch = self.searchManagerObj.
createSearch(self.SCHEDULED_CONTENT);
-
+
var query = metadataSearch.createQuery("Programme.duration", 4,
value);
metadataSearch.setQuery(query);
-
+
var offset = 0;
var count = 6;
metadataSearch.result.getResults(offset, count);
// //Must return undefined else wrong implementation of getResults method
// console.log(metaDataSearch.result[0]);
});
-
+
this.searchManagerObj.onMetadataSearch = function(search, state) {
-
+
console.log("[INFO]: onMetadataSearch called");
switch (state) {
@@ -235,16 +226,16 @@
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
-
- },
-
- testAbortWhileProgrammesSearchWithoutConstraints: function(resolve, reject) {
+
+ }
+
+ testAbortWhileProgrammesSearchWithoutConstraints(resolve, reject) {
var value = 3600;
- var self = this;
+ var self = this;
var stat = "Pending";
- logTest("State: " + stat);
+ OipfUtils.logTest("State: " + stat);
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
@@ -258,10 +249,10 @@
// console.log(metadataSearch.result[0]);
metadataSearch.result.abort();
resolve();
-
-
+
+
this.searchManagerObj.onMetadataSearch = function(search, state) {
-
+
console.log("[INFO]: onMetadataSearch called");
switch (state) {
@@ -275,7 +266,7 @@
reject();
}
break;
-
+
case 3:
var message = "[INFO] MetadataSearch in Idle state because of either search abort or parameters have been modified (query, constraints or search target)";
console.log(message);
@@ -287,13 +278,13 @@
}
};
-
- },
-
- testSetQueryWhileSearchWithoutConstraints: function(resolve, reject) {
+
+ }
+
+ testSetQueryWhileSearchWithoutConstraints(resolve, reject) {
var value = 3600;
var stat = "Pending";
- logTest("State: " + stat);
+ OipfUtils.logTest("State: " + stat);
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
@@ -312,31 +303,31 @@
} else {
reject();
}
-
- },
-
- testFindProgrammesFromStreamWhileSearchWithoutConstraints: function(resolve, reject) {
+
+ }
+
+ testFindProgrammesFromStreamWhileSearchWithoutConstraints(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
-
+
var stat = "Pending";
- logTest("State: " + stat);
+ OipfUtils.logTest("State: " + stat);
var searchTarget = 1;
var metadataSearch = self.searchManagerObj.createSearch(searchTarget);
-
+
var currentChannel = self.vidBroadObj.currentChannel;
var startTime = null;
metadataSearch.findProgrammesFromStream(currentChannel, startTime);
-
+
var offset = 0;
var count = 1;
metadataSearch.result.getResults(offset, count);
-
+
metadataSearch.findProgrammesFromStream(currentChannel, startTime);
-
+
if (self.assertEquals(metadataSearch.result.length, 0)) {
resolve();
} else {
@@ -344,30 +335,30 @@
}
});
this.vidBroadObj.bindToCurrentChannel();
-
- },
-
- testAddChannelConstraintWhileSearchWithoutConstraints: function(resolve, reject) {
+
+ }
+
+ testAddChannelConstraintWhileSearchWithoutConstraints(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
-
+
var stat = "Pending";
- logTest("State: " + stat);
+ OipfUtils.logTest("State: " + stat);
var searchTarget = 1;
var metadataSearch = self.searchManagerObj
.createSearch(searchTarget);
-
+
var currentChannel = self.vidBroadObj.currentChannel;
var startTime = null;
metadataSearch.findProgrammesFromStream(currentChannel, startTime);
-
+
var offset = 0;
var count = 1;
metadataSearch.result.getResults(offset, count);
-
+
metadataSearch.addChannelConstraint(currentChannel);
if (self.assertEquals(metadataSearch.result.length, 0)) {
@@ -376,15 +367,15 @@
reject();
}
});
-
+
this.vidBroadObj.bindToCurrentChannel();
-
- },
-
- testRemoveChannelConstraintWhileSearchWithoutConstraints: function(resolve, reject) {
+
+ }
+
+ testRemoveChannelConstraintWhileSearchWithoutConstraints(resolve, reject) {
var value = 3600;
var stat = "Pending";
- logTest("State: " + stat);
+ OipfUtils.logTest("State: " + stat);
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
@@ -395,29 +386,29 @@
var count = 6;
metadataSearch.result.getResults(offset, count);
metadataSearch.addChannelConstraint(null);
-
+
if (this.assertEquals(metadataSearch.result.length, 0)) {
resolve();
} else {
reject();
}
-
- },
-
- testGetCurrentProgrammeFromNullStream: function (resolve, reject) {
+
+ }
+
+ testGetCurrentProgrammeFromNullStream(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
-
+
var stat = "Pending";
- logTest("State: " + stat);
+ OipfUtils.logTest("State: " + stat);
var searchTarget = 1;
var metaDataSearch = self.searchManagerObj.createSearch(searchTarget);
var currentChannel = null;
var startTime = null;
- new Promise(function (resolve, reject) {
+ new Promise(function(resolve, reject) {
metaDataSearch.findProgrammesFromStream(currentChannel, startTime);
})
.catch(function(val) {
@@ -425,235 +416,235 @@
resolve();
});
});
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
+ }
- testCreateSearchForScheduledContent: function(resolve, reject) {
+ testCreateSearchForScheduledContent(resolve, reject) {
this.metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
if (this.assertNotNull(this.metadataSearch) &&
this.assertEquals(this.metadataSearch.searchTarget,
this.SCHEDULED_CONTENT)) {
- resolve();
+ resolve();
} else {
reject();
}
- },
-
- testCreateSearchForContentOnDemand: function(resolve, reject) {
+ }
+
+ testCreateSearchForContentOnDemand(resolve, reject) {
this.metadataSearch = this.searchManagerObj.
createSearch(this.CONTENT_ON_DEMAND);
if (this.assertNotNull(this.metadataSearch) &&
this.assertEquals(this.metadataSearch.searchTarget,
this.CONTENT_ON_DEMAND)) {
- resolve();
+ resolve();
} else {
reject();
}
- },
-
- testCreateSearchWithNull: function(resolve, reject) {
+ }
+
+ testCreateSearchWithNull(resolve, reject) {
this.metadataSearch = this.searchManagerObj.
createSearch(null);
if (!this.assertNotNull(this.metadataSearch)) {
- resolve();
+ resolve();
} else {
reject();
}
- },
-
- testCreateSearchWithString: function(resolve, reject) {
+ }
+
+ testCreateSearchWithString(resolve, reject) {
this.metadataSearch = this.searchManagerObj.
createSearch("1");
if (!this.assertNotNull(this.metadataSearch)) {
- resolve();
+ resolve();
} else {
reject();
}
- },
-
- testCreateSearchWithZero: function(resolve, reject) {
+ }
+
+ testCreateSearchWithZero(resolve, reject) {
this.metadataSearch = this.searchManagerObj.
createSearch(0);
if (!this.assertNotNull(this.metadataSearch)) {
- resolve();
+ resolve();
} else {
reject();
}
- },
-
- testCreateQueryWithWellArguments: function(resolve, reject) {
+ }
+
+ testCreateQueryWithWellArguments(resolve, reject) {
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
-
+
var query = metadataSearch.createQuery("name", 0, "X:ENIUS");
if (this.assertNotNull(query)) {
- resolve();
+ resolve();
} else {
reject();
}
-
- },
-
- testCreateQueryWithoutParameters: function(resolve, reject) {
+
+ }
+
+ testCreateQueryWithoutParameters(resolve, reject) {
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
-
- new Promise(function (resolve, reject) {
+
+ new Promise(function(resolve, reject) {
var query = metadataSearch.createQuery();
})
.catch(function(val) {
console.log(val);
resolve();
});
-
- },
-
- testCreateQueryWithFieldArgumentNull: function(resolve, reject) {
+
+ }
+
+ testCreateQueryWithFieldArgumentNull(resolve, reject) {
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
-
- new Promise(function (resolve, reject) {
+
+ new Promise(function(resolve, reject) {
var query = metadataSearch.createQuery(null, 0, "X:ENIUS");
})
.catch(function(val) {
console.log(val);
resolve();
});
-
- },
-
- testCreateQueryWithIntegerFieldArgument: function(resolve, reject) {
+
+ }
+
+ testCreateQueryWithIntegerFieldArgument(resolve, reject) {
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
-
- new Promise(function (resolve, reject) {
+
+ new Promise(function(resolve, reject) {
var query = metadataSearch.createQuery(10, 0, "X:ENIUS");
})
.catch(function(val) {
console.log(val);
resolve();
});
-
- },
-
- testCreateQueryWithComparisonArgumentNull: function(resolve, reject) {
+
+ }
+
+ testCreateQueryWithComparisonArgumentNull(resolve, reject) {
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
-
- new Promise(function (resolve, reject) {
+
+ new Promise(function(resolve, reject) {
metadataSearch.createQuery("name", null, "X:ENIUS");
})
.catch(function(val) {
console.log(val);
resolve();
});
-
- },
-
- testCreateQueryWithStringComparisonArgument: function(resolve, reject) {
+
+ }
+
+ testCreateQueryWithStringComparisonArgument(resolve, reject) {
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
-
- new Promise(function (resolve, reject) {
+
+ new Promise(function(resolve, reject) {
metadataSearch.createQuery("name", "null", "X:ENIUS");
})
.catch(function(val) {
console.log(val);
resolve();
});
-
- },
-
- testCreateQueryWithValueArgumentNull: function(resolve, reject) {
+
+ }
+
+ testCreateQueryWithValueArgumentNull(resolve, reject) {
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
-
- new Promise(function (resolve, reject) {
+
+ new Promise(function(resolve, reject) {
metadataSearch.createQuery("name", 0, null);
})
.catch(function(val) {
console.log(val);
resolve();
});
-
- },
-
- testAnd: function(resolve, reject) {
+
+ }
+
+ testAnd(resolve, reject) {
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
-
+
var queryA = metadataSearch.createQuery("name", 0, "X:ENIUS");
var queryB = metadataSearch.createQuery("name", 0, "X:ENIUS");
-
+
var newQuery = queryA.and(queryB);
-
- if (this.assertNotNull(newQuery) &&
+
+ if (this.assertNotNull(newQuery) &&
!this.assertEquals(newQuery, queryA)) {
-
- resolve();
+
+ resolve();
} else {
reject();
}
-
- },
-
- testOr: function(resolve, reject) {
+
+ }
+
+ testOr(resolve, reject) {
var metadataSearch = this.searchManagerObj.
createSearch(this.SCHEDULED_CONTENT);
-
+
var queryA = metadataSearch.createQuery("name", 0, "X:ENIUS");
var queryB = metadataSearch.createQuery("name", 0, "X:ENIUS");
-
+
var newQuery = queryA.or(queryB);
-
- if (this.assertNotNull(newQuery) &&
+
+ if (this.assertNotNull(newQuery) &&
!this.assertEquals(newQuery, queryA)) {
-
- resolve();
+
+ resolve();
} else {
reject();
}
-
- },
-
- testProgrammePropertiesImplementationState: function() {
+
+ }
+
+ testProgrammePropertiesImplementationState() {
var self = this;
var value = "X:ENIUS";
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
-
+
var stat = "Pending";
- logTest("State: " + stat);
+ OipfUtils.logTest("State: " + stat);
var metadataSearch = self.searchManagerObj.
createSearch(self.SCHEDULED_CONTENT);
-
+
var query = metadataSearch.createQuery("Programme.name", 0,
value);
metadataSearch.setQuery(query);
-
+
var offset = 0;
var count = 1;
metadataSearch.result.getResults(offset, count);
// //Must return undefined else wrong implementation of getResults method
// console.log(metaDataSearch.result[0]);
});
-
+
this.searchManagerObj.onMetadataSearch = function(search, state) {
-
+
console.log("[INFO]: onMetadataSearch called");
switch (state) {
@@ -687,8 +678,8 @@
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
}
-
-});
\ No newline at end of file
+
+}
Modified: oipf/test/js/Test.js
===================================================================
--- oipf/test/js/Test.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/Test.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -3,839 +3,840 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var Test = Class.extend({
- testsObjects: [{
- name : "OipfFactoryTest",
- object: new OipfFactoryTest(),
- tests: [
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfApplicationManager'.",
- method: "testIsApplicationManagerObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfCapabilities'.",
- method: "testIsCapabilitiesObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'channelConfig'.",
- method: "testIsChannelConfigSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfCodManager'.",
- method: "testIsCodManagerObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfConfiguration'.",
- method: "testIsConfigurationObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfDownloadManager'.",
- method: "testIsDownloadManagerObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfDownloadTrigger'.",
- method: "testIsDownloadTriggerObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfDrmAgent'.",
- method: "testIsDrmAgentObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfGatewayInfo'.",
- method: "testIsGatewayInfoObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfCommunicationServices'.",
- method: "testIsIMSObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfMDTF'.",
- method: "testIsMDTFObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/notifsocket'.",
- method: "testIsNotifSocketObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfParentalControlManager'.",
- method: "testIsParentalControlManagerObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfRecordingScheduler'.",
- method: "testIsRecordingSchedulerObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfRemoteControlFunction'.",
- method: "testIsRemoteControlFunctionObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfRemoteManagement'.",
- method: "testIsRemoteManagementObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfSearchManager'.",
- method: "testIsSearchManagerObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'application/oipfStatusView'.",
- method: "testIsStatusViewObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'video/broadcast'.",
- method: "testIsVideoBroadcastObjectSupported"
- },
- {
- label: "Call the method 'isObjectSupported' with mime-type 'video/mpeg'.",
- method: "testIsVideoMpegObjectSupported"
- },
- {
- label: "Call the method 'createApplicationManagerObject of oifp factory.",
- method: "testCreateApplicationManagerObject"
- },
- {
- label: "Call the method createCapabilitiesObject of oifp factory.",
- method: "testCreateCapabilitiesObject"
- },
- {
- label: "Call the method createChannelConfig of oifp factory.",
- method: "testCreateChannelConfig"
- },
- {
- label: "Call the method createCodManagerObject of oifp factory.",
- method: "testCreateCodManagerObject"
- },
- {
- label: "Call the method createConfigurationObject of oifp factory.",
- method: "testCreateConfigurationObject"
- },
- {
- label: "Call the method createDownloadManagerObject of oifp factory.",
- method: "testCreateDownloadManagerObject"
- },
- {
- label: "Call the method createDownloadTriggerObject of oifp factory.",
- method: "testCreateDownloadTriggerObject"
- },
- {
- label: "Call the method createDrmAgentObject of oifp factory.",
- method: "testCreateDrmAgentObject"
- },
- {
- label: "Call the method createGatewayInfoObject of oifp factory.",
- method: "testCreateGatewayInfoObject"
- },
- {
- label: "Call the method createImsObject of oifp factory.",
- method: "testCreateIMSObject"
- },
- {
- label: "Call the method createMdtfObject of oifp factory.",
- method: "testCreateMDTFObject"
- },
- {
- label: "Call the method createNotifSocketObject of oifp factory.",
- method: "testCreateNotifSocketObject"
- },
- {
- label: "Call the method createParentalControlManagerObject of oifp factory.",
- method: "testCreateParentalControlManagerObject"
- },
- {
- label: "Call the method createRecordingSchedulerObject of oifp factory.",
- method: "testCreateRecordingSchedulerObject"
- },
- {
- label: "Call the method createRemoteControlFunctionObject of oifp factory.",
- method: "testCreateRemoteControlFunctionObject"
- },
- {
- label: "Call the method createRemoteManagementObject of oifp factory.",
- method: "testCreateRemoteManagementObject"
- },
- {
- label: "Call the method createSearchManagerObject of oifp factory.",
- method: "testCreateSearchManagerObject"
- },
- {
- label: "Call the method createStatusViewObject of oifp factory.",
- method: "testCreateStatusViewObject"
- },
- {
- label: "Call the method createVideoBroadcastObject of oifp factory.",
- method: "testCreateVideoBroadcastObject"
- },
- {
- label: "Call the method createVideoMpegObject of oifp factory.",
- method: "testCreateVideoMpegObject"
- }
- ]},{
- name : "VideoBroadcastTest",
- object: new VideoBroadcastTest(),
- tests: [
- {
- label: "Call 'bindToCurrentChannel' when there isn't channel presentation.",
- method: "testBindToCurrentChannelWhenNoChannelPresentation"
- },
- {
- label: "Bind the current channel stream with a video broadcast object while this one is in connecting state.",
- method: "testBindToCurrentChannelInConnecting"
- },
- {
- label: "Bind the current channel stream with a video broadcast object while this one is in presenting state.",
- method: "testBindToCurrentChannelInPresenting"
- },
- {
- label: "Bind the current channel stream with a video broadcast object while this one is in stopped state.",
- method: "testBindToCurrentChannelInStopped"
- },
- {
- label: "Bind the current channel stream with a video broadcast object while this one is in stopped state.",
- method: "testBindToCurrentChannelInStoppedWhenNoTuner"
- },
- {
- label: "Call 'bindToCurrentChannel' twice.",
- method: "testDoubleBindToCurrentChannel"
- },
- {
- label: "Switch to precedent channel in unrealized state.",
- method: "testPrevChannelInUnrealized"
- },
- {
- label: "Switch to precedent channel in connecting state.",
- method: "testPrevChannelInConnecting"
- },
- {
- label: "Switch to precedent channel in presenting state.",
- method: "testPrevChannelInPresenting"
- },
- {
- label: "Switch to precedent channel in stopped state.",
- method: "testPrevChannelInStopped"
- },
- {
- label: "Switch to next channel in unrealized state.",
- method: "testNextChannelInUnrealized"
- },
- {
- label: "Switch to next channel in connecting state.",
- method: "testNextChannelInConnecting"
- },
- {
- label: "Switch to next channel in presenting state.",
- method: "testNextChannelInPresenting"
- },
- {
- label: "Switch to next channel in stopped state.",
- method: "testNextChannelInStopped"
- },
- {
- label: "Release any tuner and/or ressources held by a video broadcast object in connecting.",
- method: "testReleaseInConnecting"
- },
- {
- label: "Release any tuner and/or ressources held by a video broadcast object in presenting.",
- method: "testReleaseInPresenting"
- },
- {
- label: "Release any tuner and/or ressources held by a video broadcast object in stopped.",
- method: "testReleaseInStopped"
- },
- {
- label: "Stop the video and audio presentation of video broadcast object in connecting.",
- method: "testStopInConnecting"
- },
- {
- label: "Stop the video and audio presentation of video broadcast object in presenting.",
- method: "testStopInPresenting"
- },
- {
- label: "Set the volume of current VideoBroadcastObject to 15.",
- method: "testSetVolume"
- },
- {
- label: "Don't pass argument to method which set the volume of Video-Broadcast Object.",
- method: "testSetVolumeWithoutArgument"
- },
- {
- label: "Set the volume of current VideoBroadcastObject with a float value.",
- method: "testSetVolumeWithFloatArgument"
- },
- {
- label: "Set the volume of current VideoBroadcastObject with a float value superior of bound max.",
- method: "testSetVolumeWithFloatUnderBoundMin"
- },
- {
- label: "Set the volume of current VideoBroadcastObject with a float value inferior of bound min.",
- method: "testSetVolumeWithFloatAboveBoundMax"
- },
- {
- label: "Set the volume of current VideoBroadcastObject inferior to 0.",
- method: "testSetVolumeWithValueUnderBoundMin"
- },
- {
- label: "Set the volume of current VideoBroadcastObject superior to 100.",
- method: "testSetVolumeWithValueAboveBoundMax"
- },
- {
- label: "Get the volume of current VideoBroadcastObject.",
- method: "testGetVolume"
- },
- {
- label: "Set a channel in unrealized state.",
- method: "testSetChannelInUnrealized"
- },
- {
- label: "Set a channel in connecting state.",
- method: "testSetChannelInConnecting"
- },
- {
- label: "Call method 'setChannel' with null in connecting state.",
- method: "testSetChannelInConnectingWithNull"
- },
- {
- label: "Set a channel in presenting state.",
- method: "testSetChannelInPresenting"
- },
- {
- label: "Call method 'setChannel' with null in presenting state.",
- method: "testSetChannelInPresentingWithNull"
- },
- {
- label: "Set a channel in stopped state.",
- method: "testSetChannelInStopped"
- },
- {
- label: "Call method 'setChannel' with null in stopped state.",
- method: "testSetChannelInStoppedWithNull"
- }
- ]},{
- name: "SearchManagerTest",
- object: new SearchManagerTest(),
- tests: [
- {
- label: "Verify the right creation of search object.",
- method: "testCreateSearchForScheduledContent"
- },
- {
- label: "Verify the right creation of search object about content on demand.",
- method: "testCreateSearchForContentOnDemand"
- },
- {
- label: "Call method 'createSearch' with parameter equals to null.",
- method: "testCreateSearchWithNull"
- },
- {
- label: "Call method 'createSearch' with a String parameter.",
- method: "testCreateSearchWithString"
- },
- {
- label: "Call method 'createSearch' with parameter equals to 0.",
- method: "testCreateSearchWithZero"
- },
- {
- label: "Looking for a programme already broadcasted.",
- method: "testFindAFinishedProgramme"
- },
- {
- label: "Obtain current program according to oipf norm.",
- method: "testGetCurrentProgrammeFromStream"
- },
- {
- label: "Try to obtain current program with a null stream.",
- method: "testGetCurrentProgrammeFromNullStream"
- },
- {
- label: "Try to obtain a programme by its name.",
- method: "testSearchingForASpecificProgrammeByName"
- },
- {
- label: "Try to obtain all programme \n\
- with duration lower than one hour.",
- method: "testSearchingForProgrammesWithDurationLowerThanOneHour"
- },
- {
- label: "Create a query with well parameters.",
- method: "testCreateQueryWithWellArguments"
- },
- {
- label: "Create a query with well parameters.",
- method: "testCreateQueryWithoutParameters"
- },
- {
- label: "Create a query with its first parameters null.",
- method: "testCreateQueryWithFieldArgumentNull"
- },
- {
- label: "Create a query with a Integer as first parameter.",
- method: "testCreateQueryWithIntegerFieldArgument"
- },
- {
- label: "Create a query with its second parameters.",
- method: "testCreateQueryWithComparisonArgumentNull"
- },
- {
- label: "Create a query with a String as second parameters.",
- method: "testCreateQueryWithStringComparisonArgument"
- },
- {
- label: "Create a query with its last parameters.",
- method: "testCreateQueryWithValueArgumentNull"
- },
- {
- label: "Modify query while search performing by calling 'setQuery'.",
- method: "testSetQueryWhileSearchWithoutConstraints"
- },
- {
- label: "Call 'findProgrammesFromStream' while search performing.",
- method: "testFindProgrammesFromStreamWhileSearchWithoutConstraints"
- },
- {
- label: "Call 'addChannelConstraint' while search performing.",
- method: "testAddChannelConstraintWhileSearchWithoutConstraints"
- },
- {
- label: "Call 'removeChannelConstraint' while search performing.",
- method: "testRemoveChannelConstraintWhileSearchWithoutConstraints"
- },
- {
- label: "Abort a search.",
- method: "testAbortWhileProgrammesSearchWithoutConstraints"
- },
- {
- label: "Call method 'or' of a 'Query' object.",
- method: "testAnd"
- },
- {
- label: "Call method 'and' of a 'Query' object.",
- method: "testOr"
- }
- ]},{
- name: "ConfigurationTest",
- object: new ConfigurationTest(),
- tests: [
- {
- label: "Call method 'setScreenSize' with right parameters(Type and value).",
- method: "testSetScreenSize"
- },
- {
- label: "Call method 'setScreenSize' without parameters.",
- method: "testSetScreenSizeWithoutParameters"
- },
- {
- label: "Call method 'setScreenSize' with 'String' parameters.",
- method: "testSetScreenSizeWithUnexpectedTypeParameters"
- },
- {
- label: "Call method 'setScreenSize' with an excessive number of parameters.",
- method: "testSetScreenSizeWithExcessiveParametersNumber"
- },
- {
- label: "Call method 'setTvStandard' with right parameters(Type and value).",
- method: "testSetTvStandard"
- },
- {
- label: "Call method 'setTvStandard' without parameters.",
- method: "testSetTvStandardWihtoutParameters"
- },
- {
- label: "Call method 'setTvStandard' with wrong parameters(Type).",
- method: "testSetTvStandardWithUnexpectedTypeParameters"
- },
- {
- label: "Call method 'setTvStandard' with an excessive number of parameters.",
- method: "testSetTvStandardWithExcessiveParametersNumber"
- },
- {
- label: "Call method 'setPvrSupport' with right parameters(Type and value).",
- method: "testSetPvrSupport"
- },
- {
- label: "Call method 'setPvrSupport' without parameters.",
- method: "testSetPvrSupportWithoutParameters"
- },
- {
- label: "Call method 'setPvrSupport' with wrong parameters(Type).",
- method: "testSetPvrSupportWithUnexpectedTypeParameters"
- },
- {
- label: "Call method 'setPvrSupport' with an excessive number of parameters.",
- method: "testSetPvrSupportWithExcessiveParametersNumber"
- },
- {
- label: "Call method 'setPowerState' with right parameters(Type and value).",
- method: "testSetPowerState"
- },
- {
- label: "Call method 'setPowerState' without parameters.",
- method: "testSetPowerStateWithoutParameters"
- },
- {
- label: "Call method 'setPowerState' with wrong parameters(Type).",
- method: "testSetPowerStateWithUnexpectedTypeParameters"
- },
- {
- label: "Call method 'setPowerState' with an excessive number of parameters.",
- method: "testSetPowerStateWithExcessiveParametersNumber"
- },
- {
- label: "Call method 'setDigestCredentials' with right parameters(Type and value).",
- method: "testSetDigestCredentials"
- },
- {
- label: "Call method 'setDigestCredentials' without parameters.",
- method: "testSetDigestCredentialsWithoutParameters"
- },
- {
- label: "Call method 'setDigestCredentials' with wrong parameters(Type).",
- method: "testSetDigestCredentialsWithUnexpectedTypeParameters"
- },
- {
- label: "Call method 'setDigestCredentials' with an excessive number of parameters.",
- method: "testSetDigestCredentialsWithExcessiveParametersNumber"
- },
- {
- label: "Call method 'clearDigestCredentials' with right parameters(Type and value).",
- method: "testClearDigestCredentials"
- },
- {
- label: "Call method 'clearDigestCredentials' without parameters.",
- method: "testClearDigestCredentialsWithoutParameters"
- },
- {
- label: "Call method 'clearDigestCredentials' with wrong parameters(Type).",
- method: "testClearDigestCredentialsWithUnexpectedTypeParameters"
- },
- {
- label: "Call method 'clearDigestCredentials' with an excessive number of parameters.",
- method: "testClearDigestCredentialsWithExcessiveParametersNumber"
- },
- {
- label: "Call method 'hasDigestCredentials' with right parameters(Type and value).",
- method: "testHasDigestCredentials"
- },
- {
- label: "Call method 'hasDigestCredentials' without parameters.",
- method: "testHasDigestCredentialsWithoutParameters"
- },
- {
- label: "Call method 'hasDigestCredentials' with wrong parameters(Type).",
- method: "testHasDigestCredentialsWithUnexpectedTypeParameters"
- },
- {
- label: "Call method 'hasDigestCredentials' with an excessive number of parameters.",
- method: "testHasDigestCredentialsWithExcessiveParametersNumber"
- }
- ]},{
- name: "RecordingSchedulerTest",
- object: new RecordingSchedulerTest(),
- tests: [
- {
- label: "Call method 'setRecord' in order to record current programme.",
- method: "testRecordCurrentProgramme"
- },
- {
- label: "Try to call method 'setRecord' with a finished programme.",
- method: "testRecordAFinishedProgramme"
- },
- {
- label: "Call method 'setRecordAt' in order to record current programme.",
- method: "testRecordAtCurrentProgramme"
- },
- {
- label: "Call method 'stop' after a scheduling recording.",
- method: "testStopAScheduledRecording"
- },
- {
- label: "Call method 'stop' while a recording.",
- method: "testStopAnOngoingRecording"
- },
- {
- label: "Call method 'stop' at the end of a recording.",
- method: "testStopACompletedRecording"
- },
- {
- label: "Call method 'remove' after a scheduling recording.",
- method: "testRemoveAScheduledRecording"
- },
- {
- label: "Call method 'remove' while a recording.",
- method: "testRemoveAnOngoingRecording"
- },
- {
- label: "Call method 'remove' at the end of a recording.",
- method: "testRemoveACompletedRecording"
- },
- {
- label: "Call method 'update' to update start time of a scheduled recording",
- method: "testUpdateAScheduledRecordingOnStartTime"
- },
- {
- label: "Call method 'update' to update duration of a scheduled recording.",
- method: "testUpdateAScheduledRecordingOnDuration"
- },
- {
- label: "Call method 'update' to update duration of an in-progress recording.",
- method: "testUpdateAnOngoingRecordingWithAValidDuration"
- },
- {
- label: "Call method 'update' to update duration of an in-progress recording with a short duration.",
- method: "testUpdateAnOngoingRecordingWithATooShortDuration"
- },
- {
- label: "Call method 'update' to update start time of an in-progress recording.",
- method: "testUpdateAnOngoingRecordingOnStartTime"
- },
- {
- label: "Call method 'update' to update repetition frequency of an in-progress recording.",
- method: "testUpdateAnOngoingRecordingOnRepeatDays"
- }
- ]},{
- name: "CapabilitiesTest",
- object: new CapabilitiesTest(),
- tests: [
- {
- label: "Call method 'hasCapability' with an invalid profile name.",
- method: "testHasCapabilityWithAnInvalidProfileName"
- },
- {
- label: "Call method 'hasCapability' to verify that the TV support at least one of pre-defined base UI profiles.",
- method: "testHasCapabilityForAtLeastOneBaseProfileName"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support all pre-defined UI fragments profiles.",
- method: "testHasCapabilityForAllUIFragmentProfile"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'TRICKMODE'.",
- method: "testHasCapabilityTRICKMODE"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'AVCAD'.",
- method: "testHasCapabilityAVCAD"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'DL'.",
- method: "testHasCapabilityDL"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'IPTV_SDS'.",
- method: "testHasCapabilityIPTV_SDS"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'IPTV_URI'.",
- method: "testHasCapabilityIPTV_URI"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'ANA'.",
- method: "testHasCapabilityANA"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_C'.",
- method: "testHasCapabilityDVB_C"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_T'.",
- method: "testHasCapabilityDVB_T"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_S'.",
- method: "testHasCapabilityDVB_S"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_C2'.",
- method: "testHasCapabilityDVB_C2"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_T2'.",
- method: "testHasCapabilityDVB_T2"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_S2'.",
- method: "testHasCapabilityDVB_S2"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'ISDB_C'.",
- method: "testHasCapabilityISDB_C"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'ISDB_T'.",
- method: "testHasCapabilityISDB_T"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'ISDB_S'.",
- method: "testHasCapabilityISDB_S"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'META_BCG'.",
- method: "testHasCapabilityMETA_BCG"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'META_EIT'.",
- method: "testHasCapabilityMETA_EIT"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'META_SI'.",
- method: "testHasCapabilityMETA_SI"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'ITV_KEYS'.",
- method: "testHasCapabilityITV_KEYS"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature 'CONTROLLED'.",
- method: "testHasCapabilityCONTROLLED"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'PVR').",
- method: "testHasCapabilityPVR"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'DRM').",
- method: "testHasCapabilityDRM"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'CommunicationServices').",
- method: "testHasCapabilityCommunicationServices"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'SVG').",
- method: "testHasCapabilitySVG"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'POINTER').",
- method: "testHasCapabilityPOINTER"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'POLLNOTIF').",
- method: "testHasCapabilityPOLLNOTIF"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'HTML5_MEDIA').",
- method: "testHasCapabilityHtml5Media"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'WIDGETS').",
- method: "testHasCapabilityWIDGETS"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'RCF').",
- method: "testHasCapabilityRCF"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'TELEPHONY').",
- method: "testHasCapabilityTELEPHONY"
- },
- {
- label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'VIDEOTELEPHONY').",
- method: "testHasCapabilityVIDEOTELEPHONY"
- }
- ]},{
- name: "ParentalControlManagerTest",
- object: new ParentalControlManagerTest(),
- tests: [
- {
- label: "Call method 'setParentalControlPIN' with valids parameters.",
- method: "testSetParentalControlPINWithValidOldPINAndNewPIN"
- },
- {
- label: "Call method 'setParentalControlPIN' with a invalid pin but a valid new pin.",
- method: "testSetParentalControlPINWithInvalidOldPINAndValidNewPIN"
- },
- {
- label: "Call method 'setParentalControlPIN' with a invalid pin but a valid new pin.",
- method: "testSetParentalControlPINWithInvalidOldPINAndValidNewPIN10Times"
- },
- {
- label: "Call method 'verifyParentalControlPIN' with an invalid pin 10 times.",
- method: "testVerifyParentalControlPINWithInvalidPIN10Times"
- },
- {
- label: "Call method 'verifyParentalControlPIN' with a valid pin.",
- method: "testVerifyParentalControlPINWithValidPIN"
- },
- {
- label: "Call method 'verifyParentalControlPIN' with an invalid pin.",
- method: "testVerifyParentalControlPINWithInvalidPIN"
- },
- {
- label: "Call method 'setBlockUnrated' with an invalid pin.",
- method: "testSetBlockUnratedWithInvalidPIN10Times"
- },
- {
- label: "Call method 'getBlockUnrated' when contents have not been blocked.",
- method: "testGetBlockUnratedWhenUnratedContentsAreNotBlocked"
- },
- {
- label: "Call method 'getBlockUnrated' when contents have been blocked.",
- method: "testGetBlockUnratedWhenUnratedContentsAreBlocked"
- },
- {
- label: "Call method 'setBlockUnrated' with a valid pin and value 'true' to blocked unrated contents.",
- method: "testSetBlockUnratedWithValidPINAndTrue"
- },
- {
- label: "Call method 'setBlockUnrated' with a valid pin and value 'false' to don't blocked unrated contents.",
- method: "testSetBlockUnratedWithValidPINAndFalse"
- },
- {
- label: "Call method 'setBlockUnrated' with an invalid pin and value 'true' to blocked unrated contents.",
- method: "testSetBlockUnratedWithInvalidPINAndTrue"
- },
- {
- label: "Call method 'setBlockUnrated' with an invalid pin and value 'false' to don't blocked unrated contents.",
- method: "testSetBlockUnratedWithInvalidPINAndFalse"
- },
- {
- label: "Call method 'setParentalControlStatus' with a valid pin\
- and value 'true' to active parental control.",
- method: "testSetParentalControlStatusWithValidPINAndTrue"
- },
- {
- label: "Call method 'setParentalControlStatus' with a valid pin\
- and value 'false' to desactive parental control.",
- method: "testSetParentalControlStatusWithValidPINAndFalse"
- },
- {
- label: "Call method 'setParentalControlStatus' with an invalid\
- pin and value 'true' to active parental control.",
- method: "testSetParentalControlStatusWithInvalidPINAndTrue"
- },
- {
- label: "Call method 'setParentalControlStatus' with an invalid\
- pin and value 'false' to desactive parental control.",
- method: "testSetParentalControlStatusWithInvalidPINAndFalse"
- },
- {
- label: "Call method 'setParentalControlStatus' with an invalid\
- pin and value 'false' to verify the PIN entry locking",
- method: "testSetParentalControlStatusWithInvalidOldPINAndValidNewPIN10Times"
- },
- {
- label: "Call method 'getParentalControlStatus' when parental\
- control status is activated.",
- method: "testGetParentalControlStatusWhenParentalControlStatusActivated"
- },
- {
- label: "Call method 'getParentalControlStatus' when parental\
- control status is deactivated.",
- method: "testGetParentalControlStatusWhenParentalControlStatusDeactivated"
- }
- ]},{
- name: "ApplicationManagerTest",
- object: new ApplicationManagerTest(),
- tests: [
- {
- label: "Call method 'getOwnerApplication' with 'object document' of global property 'window'.",
- method: "testGetOwnerApplicationOfDocumentOfGlobalPropertyWindow"
- },
- {
- label: "Call method 'getOwnerApplication' with a parameter null.",
- method: "testGetOwnerApplicationWithNull"
- }
- ]
- }],
+class Test {
- init: function() {
+ constructor() {
+ this.testsObjects = [{
+ name : "OipfFactoryTest",
+ object: new OipfFactoryTest(),
+ tests: [
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfApplicationManager'.",
+ method: "testIsApplicationManagerObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfCapabilities'.",
+ method: "testIsCapabilitiesObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'channelConfig'.",
+ method: "testIsChannelConfigSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfCodManager'.",
+ method: "testIsCodManagerObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfConfiguration'.",
+ method: "testIsConfigurationObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfDownloadManager'.",
+ method: "testIsDownloadManagerObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfDownloadTrigger'.",
+ method: "testIsDownloadTriggerObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfDrmAgent'.",
+ method: "testIsDrmAgentObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfGatewayInfo'.",
+ method: "testIsGatewayInfoObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfCommunicationServices'.",
+ method: "testIsIMSObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfMDTF'.",
+ method: "testIsMDTFObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/notifsocket'.",
+ method: "testIsNotifSocketObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfParentalControlManager'.",
+ method: "testIsParentalControlManagerObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfRecordingScheduler'.",
+ method: "testIsRecordingSchedulerObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfRemoteControlFunction'.",
+ method: "testIsRemoteControlFunctionObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfRemoteManagement'.",
+ method: "testIsRemoteManagementObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfSearchManager'.",
+ method: "testIsSearchManagerObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'application/oipfStatusView'.",
+ method: "testIsStatusViewObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'video/broadcast'.",
+ method: "testIsVideoBroadcastObjectSupported"
+ },
+ {
+ label: "Call the method 'isObjectSupported' with mime-type 'video/mpeg'.",
+ method: "testIsVideoMpegObjectSupported"
+ },
+ {
+ label: "Call the method 'createApplicationManagerObject of oifp factory.",
+ method: "testCreateApplicationManagerObject"
+ },
+ {
+ label: "Call the method createCapabilitiesObject of oifp factory.",
+ method: "testCreateCapabilitiesObject"
+ },
+ {
+ label: "Call the method createChannelConfig of oifp factory.",
+ method: "testCreateChannelConfig"
+ },
+ {
+ label: "Call the method createCodManagerObject of oifp factory.",
+ method: "testCreateCodManagerObject"
+ },
+ {
+ label: "Call the method createConfigurationObject of oifp factory.",
+ method: "testCreateConfigurationObject"
+ },
+ {
+ label: "Call the method createDownloadManagerObject of oifp factory.",
+ method: "testCreateDownloadManagerObject"
+ },
+ {
+ label: "Call the method createDownloadTriggerObject of oifp factory.",
+ method: "testCreateDownloadTriggerObject"
+ },
+ {
+ label: "Call the method createDrmAgentObject of oifp factory.",
+ method: "testCreateDrmAgentObject"
+ },
+ {
+ label: "Call the method createGatewayInfoObject of oifp factory.",
+ method: "testCreateGatewayInfoObject"
+ },
+ {
+ label: "Call the method createImsObject of oifp factory.",
+ method: "testCreateIMSObject"
+ },
+ {
+ label: "Call the method createMdtfObject of oifp factory.",
+ method: "testCreateMDTFObject"
+ },
+ {
+ label: "Call the method createNotifSocketObject of oifp factory.",
+ method: "testCreateNotifSocketObject"
+ },
+ {
+ label: "Call the method createParentalControlManagerObject of oifp factory.",
+ method: "testCreateParentalControlManagerObject"
+ },
+ {
+ label: "Call the method createRecordingSchedulerObject of oifp factory.",
+ method: "testCreateRecordingSchedulerObject"
+ },
+ {
+ label: "Call the method createRemoteControlFunctionObject of oifp factory.",
+ method: "testCreateRemoteControlFunctionObject"
+ },
+ {
+ label: "Call the method createRemoteManagementObject of oifp factory.",
+ method: "testCreateRemoteManagementObject"
+ },
+ {
+ label: "Call the method createSearchManagerObject of oifp factory.",
+ method: "testCreateSearchManagerObject"
+ },
+ {
+ label: "Call the method createStatusViewObject of oifp factory.",
+ method: "testCreateStatusViewObject"
+ },
+ {
+ label: "Call the method createVideoBroadcastObject of oifp factory.",
+ method: "testCreateVideoBroadcastObject"
+ },
+ {
+ label: "Call the method createVideoMpegObject of oifp factory.",
+ method: "testCreateVideoMpegObject"
+ }
+ ]},{
+ name : "VideoBroadcastTest",
+ object: new VideoBroadcastTest(),
+ tests: [
+ {
+ label: "Call 'bindToCurrentChannel' when there isn't channel presentation.",
+ method: "testBindToCurrentChannelWhenNoChannelPresentation"
+ },
+ {
+ label: "Bind the current channel stream with a video broadcast object while this one is in connecting state.",
+ method: "testBindToCurrentChannelInConnecting"
+ },
+ {
+ label: "Bind the current channel stream with a video broadcast object while this one is in presenting state.",
+ method: "testBindToCurrentChannelInPresenting"
+ },
+ {
+ label: "Bind the current channel stream with a video broadcast object while this one is in stopped state.",
+ method: "testBindToCurrentChannelInStopped"
+ },
+ {
+ label: "Bind the current channel stream with a video broadcast object while this one is in stopped state.",
+ method: "testBindToCurrentChannelInStoppedWhenNoTuner"
+ },
+ {
+ label: "Call 'bindToCurrentChannel' twice.",
+ method: "testDoubleBindToCurrentChannel"
+ },
+ {
+ label: "Switch to precedent channel in unrealized state.",
+ method: "testPrevChannelInUnrealized"
+ },
+ {
+ label: "Switch to precedent channel in connecting state.",
+ method: "testPrevChannelInConnecting"
+ },
+ {
+ label: "Switch to precedent channel in presenting state.",
+ method: "testPrevChannelInPresenting"
+ },
+ {
+ label: "Switch to precedent channel in stopped state.",
+ method: "testPrevChannelInStopped"
+ },
+ {
+ label: "Switch to next channel in unrealized state.",
+ method: "testNextChannelInUnrealized"
+ },
+ {
+ label: "Switch to next channel in connecting state.",
+ method: "testNextChannelInConnecting"
+ },
+ {
+ label: "Switch to next channel in presenting state.",
+ method: "testNextChannelInPresenting"
+ },
+ {
+ label: "Switch to next channel in stopped state.",
+ method: "testNextChannelInStopped"
+ },
+ {
+ label: "Release any tuner and/or ressources held by a video broadcast object in connecting.",
+ method: "testReleaseInConnecting"
+ },
+ {
+ label: "Release any tuner and/or ressources held by a video broadcast object in presenting.",
+ method: "testReleaseInPresenting"
+ },
+ {
+ label: "Release any tuner and/or ressources held by a video broadcast object in stopped.",
+ method: "testReleaseInStopped"
+ },
+ {
+ label: "Stop the video and audio presentation of video broadcast object in connecting.",
+ method: "testStopInConnecting"
+ },
+ {
+ label: "Stop the video and audio presentation of video broadcast object in presenting.",
+ method: "testStopInPresenting"
+ },
+ {
+ label: "Set the volume of current VideoBroadcastObject to 15.",
+ method: "testSetVolume"
+ },
+ {
+ label: "Don't pass argument to method which set the volume of Video-Broadcast Object.",
+ method: "testSetVolumeWithoutArgument"
+ },
+ {
+ label: "Set the volume of current VideoBroadcastObject with a float value.",
+ method: "testSetVolumeWithFloatArgument"
+ },
+ {
+ label: "Set the volume of current VideoBroadcastObject with a float value superior of bound max.",
+ method: "testSetVolumeWithFloatUnderBoundMin"
+ },
+ {
+ label: "Set the volume of current VideoBroadcastObject with a float value inferior of bound min.",
+ method: "testSetVolumeWithFloatAboveBoundMax"
+ },
+ {
+ label: "Set the volume of current VideoBroadcastObject inferior to 0.",
+ method: "testSetVolumeWithValueUnderBoundMin"
+ },
+ {
+ label: "Set the volume of current VideoBroadcastObject superior to 100.",
+ method: "testSetVolumeWithValueAboveBoundMax"
+ },
+ {
+ label: "Get the volume of current VideoBroadcastObject.",
+ method: "testGetVolume"
+ },
+ {
+ label: "Set a channel in unrealized state.",
+ method: "testSetChannelInUnrealized"
+ },
+ {
+ label: "Set a channel in connecting state.",
+ method: "testSetChannelInConnecting"
+ },
+ {
+ label: "Call method 'setChannel' with null in connecting state.",
+ method: "testSetChannelInConnectingWithNull"
+ },
+ {
+ label: "Set a channel in presenting state.",
+ method: "testSetChannelInPresenting"
+ },
+ {
+ label: "Call method 'setChannel' with null in presenting state.",
+ method: "testSetChannelInPresentingWithNull"
+ },
+ {
+ label: "Set a channel in stopped state.",
+ method: "testSetChannelInStopped"
+ },
+ {
+ label: "Call method 'setChannel' with null in stopped state.",
+ method: "testSetChannelInStoppedWithNull"
+ }
+ ]},{
+ name: "SearchManagerTest",
+ object: new SearchManagerTest(),
+ tests: [
+ {
+ label: "Verify the right creation of search object.",
+ method: "testCreateSearchForScheduledContent"
+ },
+ {
+ label: "Verify the right creation of search object about content on demand.",
+ method: "testCreateSearchForContentOnDemand"
+ },
+ {
+ label: "Call method 'createSearch' with parameter equals to null.",
+ method: "testCreateSearchWithNull"
+ },
+ {
+ label: "Call method 'createSearch' with a String parameter.",
+ method: "testCreateSearchWithString"
+ },
+ {
+ label: "Call method 'createSearch' with parameter equals to 0.",
+ method: "testCreateSearchWithZero"
+ },
+ {
+ label: "Looking for a programme already broadcasted.",
+ method: "testFindAFinishedProgramme"
+ },
+ {
+ label: "Obtain current program according to oipf norm.",
+ method: "testGetCurrentProgrammeFromStream"
+ },
+ {
+ label: "Try to obtain current program with a null stream.",
+ method: "testGetCurrentProgrammeFromNullStream"
+ },
+ {
+ label: "Try to obtain a programme by its name.",
+ method: "testSearchingForASpecificProgrammeByName"
+ },
+ {
+ label: "Try to obtain all programme \n\
+ with duration lower than one hour.",
+ method: "testSearchingForProgrammesWithDurationLowerThanOneHour"
+ },
+ {
+ label: "Create a query with well parameters.",
+ method: "testCreateQueryWithWellArguments"
+ },
+ {
+ label: "Create a query with well parameters.",
+ method: "testCreateQueryWithoutParameters"
+ },
+ {
+ label: "Create a query with its first parameters null.",
+ method: "testCreateQueryWithFieldArgumentNull"
+ },
+ {
+ label: "Create a query with a Integer as first parameter.",
+ method: "testCreateQueryWithIntegerFieldArgument"
+ },
+ {
+ label: "Create a query with its second parameters.",
+ method: "testCreateQueryWithComparisonArgumentNull"
+ },
+ {
+ label: "Create a query with a String as second parameters.",
+ method: "testCreateQueryWithStringComparisonArgument"
+ },
+ {
+ label: "Create a query with its last parameters.",
+ method: "testCreateQueryWithValueArgumentNull"
+ },
+ {
+ label: "Modify query while search performing by calling 'setQuery'.",
+ method: "testSetQueryWhileSearchWithoutConstraints"
+ },
+ {
+ label: "Call 'findProgrammesFromStream' while search performing.",
+ method: "testFindProgrammesFromStreamWhileSearchWithoutConstraints"
+ },
+ {
+ label: "Call 'addChannelConstraint' while search performing.",
+ method: "testAddChannelConstraintWhileSearchWithoutConstraints"
+ },
+ {
+ label: "Call 'removeChannelConstraint' while search performing.",
+ method: "testRemoveChannelConstraintWhileSearchWithoutConstraints"
+ },
+ {
+ label: "Abort a search.",
+ method: "testAbortWhileProgrammesSearchWithoutConstraints"
+ },
+ {
+ label: "Call method 'or' of a 'Query' object.",
+ method: "testAnd"
+ },
+ {
+ label: "Call method 'and' of a 'Query' object.",
+ method: "testOr"
+ }
+ ]},{
+ name: "ConfigurationTest",
+ object: new ConfigurationTest(),
+ tests: [
+ {
+ label: "Call method 'setScreenSize' with right parameters(Type and value).",
+ method: "testSetScreenSize"
+ },
+ {
+ label: "Call method 'setScreenSize' without parameters.",
+ method: "testSetScreenSizeWithoutParameters"
+ },
+ {
+ label: "Call method 'setScreenSize' with 'String' parameters.",
+ method: "testSetScreenSizeWithUnexpectedTypeParameters"
+ },
+ {
+ label: "Call method 'setScreenSize' with an excessive number of parameters.",
+ method: "testSetScreenSizeWithExcessiveParametersNumber"
+ },
+ {
+ label: "Call method 'setTvStandard' with right parameters(Type and value).",
+ method: "testSetTvStandard"
+ },
+ {
+ label: "Call method 'setTvStandard' without parameters.",
+ method: "testSetTvStandardWihtoutParameters"
+ },
+ {
+ label: "Call method 'setTvStandard' with wrong parameters(Type).",
+ method: "testSetTvStandardWithUnexpectedTypeParameters"
+ },
+ {
+ label: "Call method 'setTvStandard' with an excessive number of parameters.",
+ method: "testSetTvStandardWithExcessiveParametersNumber"
+ },
+ {
+ label: "Call method 'setPvrSupport' with right parameters(Type and value).",
+ method: "testSetPvrSupport"
+ },
+ {
+ label: "Call method 'setPvrSupport' without parameters.",
+ method: "testSetPvrSupportWithoutParameters"
+ },
+ {
+ label: "Call method 'setPvrSupport' with wrong parameters(Type).",
+ method: "testSetPvrSupportWithUnexpectedTypeParameters"
+ },
+ {
+ label: "Call method 'setPvrSupport' with an excessive number of parameters.",
+ method: "testSetPvrSupportWithExcessiveParametersNumber"
+ },
+ {
+ label: "Call method 'setPowerState' with right parameters(Type and value).",
+ method: "testSetPowerState"
+ },
+ {
+ label: "Call method 'setPowerState' without parameters.",
+ method: "testSetPowerStateWithoutParameters"
+ },
+ {
+ label: "Call method 'setPowerState' with wrong parameters(Type).",
+ method: "testSetPowerStateWithUnexpectedTypeParameters"
+ },
+ {
+ label: "Call method 'setPowerState' with an excessive number of parameters.",
+ method: "testSetPowerStateWithExcessiveParametersNumber"
+ },
+ {
+ label: "Call method 'setDigestCredentials' with right parameters(Type and value).",
+ method: "testSetDigestCredentials"
+ },
+ {
+ label: "Call method 'setDigestCredentials' without parameters.",
+ method: "testSetDigestCredentialsWithoutParameters"
+ },
+ {
+ label: "Call method 'setDigestCredentials' with wrong parameters(Type).",
+ method: "testSetDigestCredentialsWithUnexpectedTypeParameters"
+ },
+ {
+ label: "Call method 'setDigestCredentials' with an excessive number of parameters.",
+ method: "testSetDigestCredentialsWithExcessiveParametersNumber"
+ },
+ {
+ label: "Call method 'clearDigestCredentials' with right parameters(Type and value).",
+ method: "testClearDigestCredentials"
+ },
+ {
+ label: "Call method 'clearDigestCredentials' without parameters.",
+ method: "testClearDigestCredentialsWithoutParameters"
+ },
+ {
+ label: "Call method 'clearDigestCredentials' with wrong parameters(Type).",
+ method: "testClearDigestCredentialsWithUnexpectedTypeParameters"
+ },
+ {
+ label: "Call method 'clearDigestCredentials' with an excessive number of parameters.",
+ method: "testClearDigestCredentialsWithExcessiveParametersNumber"
+ },
+ {
+ label: "Call method 'hasDigestCredentials' with right parameters(Type and value).",
+ method: "testHasDigestCredentials"
+ },
+ {
+ label: "Call method 'hasDigestCredentials' without parameters.",
+ method: "testHasDigestCredentialsWithoutParameters"
+ },
+ {
+ label: "Call method 'hasDigestCredentials' with wrong parameters(Type).",
+ method: "testHasDigestCredentialsWithUnexpectedTypeParameters"
+ },
+ {
+ label: "Call method 'hasDigestCredentials' with an excessive number of parameters.",
+ method: "testHasDigestCredentialsWithExcessiveParametersNumber"
+ }
+ ]},{
+ name: "RecordingSchedulerTest",
+ object: new RecordingSchedulerTest(),
+ tests: [
+ {
+ label: "Call method 'setRecord' in order to record current programme.",
+ method: "testRecordCurrentProgramme"
+ },
+ {
+ label: "Try to call method 'setRecord' with a finished programme.",
+ method: "testRecordAFinishedProgramme"
+ },
+ {
+ label: "Call method 'setRecordAt' in order to record current programme.",
+ method: "testRecordAtCurrentProgramme"
+ },
+ {
+ label: "Call method 'stop' after a scheduling recording.",
+ method: "testStopAScheduledRecording"
+ },
+ {
+ label: "Call method 'stop' while a recording.",
+ method: "testStopAnOngoingRecording"
+ },
+ {
+ label: "Call method 'stop' at the end of a recording.",
+ method: "testStopACompletedRecording"
+ },
+ {
+ label: "Call method 'remove' after a scheduling recording.",
+ method: "testRemoveAScheduledRecording"
+ },
+ {
+ label: "Call method 'remove' while a recording.",
+ method: "testRemoveAnOngoingRecording"
+ },
+ {
+ label: "Call method 'remove' at the end of a recording.",
+ method: "testRemoveACompletedRecording"
+ },
+ {
+ label: "Call method 'update' to update start time of a scheduled recording",
+ method: "testUpdateAScheduledRecordingOnStartTime"
+ },
+ {
+ label: "Call method 'update' to update duration of a scheduled recording.",
+ method: "testUpdateAScheduledRecordingOnDuration"
+ },
+ {
+ label: "Call method 'update' to update duration of an in-progress recording.",
+ method: "testUpdateAnOngoingRecordingWithAValidDuration"
+ },
+ {
+ label: "Call method 'update' to update duration of an in-progress recording with a short duration.",
+ method: "testUpdateAnOngoingRecordingWithATooShortDuration"
+ },
+ {
+ label: "Call method 'update' to update start time of an in-progress recording.",
+ method: "testUpdateAnOngoingRecordingOnStartTime"
+ },
+ {
+ label: "Call method 'update' to update repetition frequency of an in-progress recording.",
+ method: "testUpdateAnOngoingRecordingOnRepeatDays"
+ }
+ ]},{
+ name: "CapabilitiesTest",
+ object: new CapabilitiesTest(),
+ tests: [
+ {
+ label: "Call method 'hasCapability' with an invalid profile name.",
+ method: "testHasCapabilityWithAnInvalidProfileName"
+ },
+ {
+ label: "Call method 'hasCapability' to verify that the TV support at least one of pre-defined base UI profiles.",
+ method: "testHasCapabilityForAtLeastOneBaseProfileName"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support all pre-defined UI fragments profiles.",
+ method: "testHasCapabilityForAllUIFragmentProfile"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'TRICKMODE'.",
+ method: "testHasCapabilityTRICKMODE"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'AVCAD'.",
+ method: "testHasCapabilityAVCAD"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'DL'.",
+ method: "testHasCapabilityDL"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'IPTV_SDS'.",
+ method: "testHasCapabilityIPTV_SDS"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'IPTV_URI'.",
+ method: "testHasCapabilityIPTV_URI"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'ANA'.",
+ method: "testHasCapabilityANA"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_C'.",
+ method: "testHasCapabilityDVB_C"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_T'.",
+ method: "testHasCapabilityDVB_T"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_S'.",
+ method: "testHasCapabilityDVB_S"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_C2'.",
+ method: "testHasCapabilityDVB_C2"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_T2'.",
+ method: "testHasCapabilityDVB_T2"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'DVB_S2'.",
+ method: "testHasCapabilityDVB_S2"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'ISDB_C'.",
+ method: "testHasCapabilityISDB_C"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'ISDB_T'.",
+ method: "testHasCapabilityISDB_T"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'ISDB_S'.",
+ method: "testHasCapabilityISDB_S"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'META_BCG'.",
+ method: "testHasCapabilityMETA_BCG"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'META_EIT'.",
+ method: "testHasCapabilityMETA_EIT"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'META_SI'.",
+ method: "testHasCapabilityMETA_SI"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'ITV_KEYS'.",
+ method: "testHasCapabilityITV_KEYS"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature 'CONTROLLED'.",
+ method: "testHasCapabilityCONTROLLED"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'PVR').",
+ method: "testHasCapabilityPVR"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'DRM').",
+ method: "testHasCapabilityDRM"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'CommunicationServices').",
+ method: "testHasCapabilityCommunicationServices"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'SVG').",
+ method: "testHasCapabilitySVG"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'POINTER').",
+ method: "testHasCapabilityPOINTER"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'POLLNOTIF').",
+ method: "testHasCapabilityPOLLNOTIF"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'HTML5_MEDIA').",
+ method: "testHasCapabilityHtml5Media"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'WIDGETS').",
+ method: "testHasCapabilityWIDGETS"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'RCF').",
+ method: "testHasCapabilityRCF"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'TELEPHONY').",
+ method: "testHasCapabilityTELEPHONY"
+ },
+ {
+ label: "Call method 'hasCapability' to verify if the TV support the feature recording(UI profile name fragment: 'VIDEOTELEPHONY').",
+ method: "testHasCapabilityVIDEOTELEPHONY"
+ }
+ ]},{
+ name: "ParentalControlManagerTest",
+ object: new ParentalControlManagerTest(),
+ tests: [
+ {
+ label: "Call method 'setParentalControlPIN' with valids parameters.",
+ method: "testSetParentalControlPINWithValidOldPINAndNewPIN"
+ },
+ {
+ label: "Call method 'setParentalControlPIN' with a invalid pin but a valid new pin.",
+ method: "testSetParentalControlPINWithInvalidOldPINAndValidNewPIN"
+ },
+ {
+ label: "Call method 'setParentalControlPIN' with a invalid pin but a valid new pin.",
+ method: "testSetParentalControlPINWithInvalidOldPINAndValidNewPIN10Times"
+ },
+ {
+ label: "Call method 'verifyParentalControlPIN' with an invalid pin 10 times.",
+ method: "testVerifyParentalControlPINWithInvalidPIN10Times"
+ },
+ {
+ label: "Call method 'verifyParentalControlPIN' with a valid pin.",
+ method: "testVerifyParentalControlPINWithValidPIN"
+ },
+ {
+ label: "Call method 'verifyParentalControlPIN' with an invalid pin.",
+ method: "testVerifyParentalControlPINWithInvalidPIN"
+ },
+ {
+ label: "Call method 'setBlockUnrated' with an invalid pin.",
+ method: "testSetBlockUnratedWithInvalidPIN10Times"
+ },
+ {
+ label: "Call method 'getBlockUnrated' when contents have not been blocked.",
+ method: "testGetBlockUnratedWhenUnratedContentsAreNotBlocked"
+ },
+ {
+ label: "Call method 'getBlockUnrated' when contents have been blocked.",
+ method: "testGetBlockUnratedWhenUnratedContentsAreBlocked"
+ },
+ {
+ label: "Call method 'setBlockUnrated' with a valid pin and value 'true' to blocked unrated contents.",
+ method: "testSetBlockUnratedWithValidPINAndTrue"
+ },
+ {
+ label: "Call method 'setBlockUnrated' with a valid pin and value 'false' to don't blocked unrated contents.",
+ method: "testSetBlockUnratedWithValidPINAndFalse"
+ },
+ {
+ label: "Call method 'setBlockUnrated' with an invalid pin and value 'true' to blocked unrated contents.",
+ method: "testSetBlockUnratedWithInvalidPINAndTrue"
+ },
+ {
+ label: "Call method 'setBlockUnrated' with an invalid pin and value 'false' to don't blocked unrated contents.",
+ method: "testSetBlockUnratedWithInvalidPINAndFalse"
+ },
+ {
+ label: "Call method 'setParentalControlStatus' with a valid pin\
+ and value 'true' to active parental control.",
+ method: "testSetParentalControlStatusWithValidPINAndTrue"
+ },
+ {
+ label: "Call method 'setParentalControlStatus' with a valid pin\
+ and value 'false' to desactive parental control.",
+ method: "testSetParentalControlStatusWithValidPINAndFalse"
+ },
+ {
+ label: "Call method 'setParentalControlStatus' with an invalid\
+ pin and value 'true' to active parental control.",
+ method: "testSetParentalControlStatusWithInvalidPINAndTrue"
+ },
+ {
+ label: "Call method 'setParentalControlStatus' with an invalid\
+ pin and value 'false' to desactive parental control.",
+ method: "testSetParentalControlStatusWithInvalidPINAndFalse"
+ },
+ {
+ label: "Call method 'setParentalControlStatus' with an invalid\
+ pin and value 'false' to verify the PIN entry locking",
+ method: "testSetParentalControlStatusWithInvalidOldPINAndValidNewPIN10Times"
+ },
+ {
+ label: "Call method 'getParentalControlStatus' when parental\
+ control status is activated.",
+ method: "testGetParentalControlStatusWhenParentalControlStatusActivated"
+ },
+ {
+ label: "Call method 'getParentalControlStatus' when parental\
+ control status is deactivated.",
+ method: "testGetParentalControlStatusWhenParentalControlStatusDeactivated"
+ }
+ ]},{
+ name: "ApplicationManagerTest",
+ object: new ApplicationManagerTest(),
+ tests: [
+ {
+ label: "Call method 'getOwnerApplication' with 'object document' of global property 'window'.",
+ method: "testGetOwnerApplicationOfDocumentOfGlobalPropertyWindow"
+ },
+ {
+ label: "Call method 'getOwnerApplication' with a parameter null.",
+ method: "testGetOwnerApplicationWithNull"
+ }
+ ]
+ }];
+
this.animation = {
i: 1,
start: true,
@@ -843,18 +844,18 @@
};
this.sectionsID = [];
- },
+ }
- runAll: function() {
+ runAll() {
this.results = [];
this.currentResult = {
succeeded: 0,
failed: 0
};
this.runLoop(0, 0).then(this.totalPercentage.bind(this));
- },
+ }
- runLoop: function(indexObject, indexTest) {
+ runLoop(indexObject, indexTest) {
var element = this.testsObjects[indexObject];
var object = element.object;
var tests = element.tests;
@@ -893,16 +894,16 @@
return this.updateTestResult(tests[indexTest], object)
.then(loop).catch(loop);
- },
+ }
- percentageCalculating: function(currentResult) {
+ percentageCalculating(currentResult) {
this.round = Math.round.bind(Math);
var testNumber = currentResult.failed + currentResult.succeeded;
currentResult.failed = this.round((currentResult.failed / testNumber) * 100);
currentResult.succeeded = this.round((currentResult.succeeded / testNumber) * 100);
- },
+ }
- totalPercentage: function() {
+ totalPercentage() {
this.resultsPercentageFailed = 0;
this.resultsPercentageSucceeded = 0;
@@ -916,9 +917,9 @@
this.resultsPercentageFailed = this.resultsPercentageFailed/this.testsObjects.length;
this.resultsPercentageSucceeded = this.resultsPercentageSucceeded/this.testsObjects.length;
this.displayGlobalTestResults();
- },
+ }
- displayGlobalTestResults: function() {
+ displayGlobalTestResults() {
var id = "globalTestResultsTable";
var tableResult = document.getElementById(id);
var content = "";
@@ -950,9 +951,9 @@
var style = document.getElementById("globalTestResultsDiv").style;
style.display = (!style.display || style.display == "none") ? "block" : "none";
- },
+ }
- runSectionTest : function(indexObject, indexTest) {
+ runSectionTest(indexObject, indexTest) {
var element = this.testsObjects[indexObject];
var object = element.object;
var tests = element.tests;
@@ -966,17 +967,17 @@
this.updateTestResult(tests[indexTest], object)
.then(loop).catch(loop);
- },
+ }
- run: function(indexObject, indexTest) {
+ run(indexObject, indexTest) {
var element = this.testsObjects[indexObject];
var object = element.object;
var tests = element.tests;
return this.updateTestResult(tests[indexTest], object);
- },
+ }
- displayInLineArray: function() {
+ displayInLineArray() {
var content = "<div id='testsDisplay'>";
content += "<div id='title'><h1>OIPF Tests</h1></div>";
content += "<div id='testControllerDiv'>";
@@ -1035,9 +1036,9 @@
content += "</div>";
content += "</div>";
document.body.innerHTML += content;
- },
+ }
- updateTestResult: function(currentTest, object) {
+ updateTestResult(currentTest, object) {
this.updateTestResultStart(currentTest);
console.group(currentTest["label"]);
@@ -1085,34 +1086,34 @@
});
return promiseTest;
- },
+ }
- updateTestResultStart: function(currentTest) {
+ updateTestResultStart(currentTest) {
document.getElementById(currentTest["method"] + "Result").textContent = "None";
document.getElementById(currentTest["method"] + "Result").className = "";
document.getElementById(currentTest["method"] + "Duration").textContent = "None";
- },
+ }
- updateTestResultSuccess: function(timeStart, timeEnd, currentTest, message) {
+ updateTestResultSuccess(timeStart, timeEnd, currentTest, message) {
document.getElementById(currentTest["method"] + "Result").textContent = message || "Success";
document.getElementById(currentTest["method"] + "Result").className = "success";
document.getElementById(currentTest["method"] + "Duration").textContent = (timeEnd - timeStart).toFixed(2) + " ms";
- },
+ }
- updateTestResultError: function(timeStart, timeEnd, currentTest, message) {
+ updateTestResultError(timeStart, timeEnd, currentTest, message) {
document.getElementById(currentTest["method"] + "Result").textContent = message || "Error";
document.getElementById(currentTest["method"] + "Result").className = this.colorManaging(message);
document.getElementById(currentTest["method"] + "Duration").textContent = (timeEnd - timeStart).toFixed(2) + " ms";
- },
+ }
- startAnimationInProgress: function(currentTest) {
+ startAnimationInProgress(currentTest) {
var self = this;
self.animation.intervalID = setInterval(function() {
var currentTestResult = document
.getElementById(currentTest["method"] + "Result");
- if((self.animation.i%6) == 0) {
+ if ((self.animation.i % 6) == 0) {
currentTestResult.textContent = "*";
self.animation.i = 1;
} else {
@@ -1127,18 +1128,18 @@
}
}, 500);
- },
+ }
- stopAnimationInProgress: function(object, currentTest) {
+ stopAnimationInProgress(object, currentTest) {
clearInterval(this.animation.intervalID);
this.animation.id = 1;
this.animation.start = true;
this.animation.intervalID = null;
- },
+ }
- colorManaging: function(errorMessage) {
+ colorManaging(errorMessage) {
var map = {
"No result returned.": "error",
"Untestable case for the moment.": "error",
@@ -1155,7 +1156,4 @@
return "error";
}
}
-
-});
-
-
+}
Modified: oipf/test/js/TestCase.js
===================================================================
--- oipf/test/js/TestCase.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/TestCase.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -1,11 +1,11 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var TestCase = Class.extend({
-
- init: function() {
+class TestCase {
+
+ construtor() {
this.modelFactory = new ModelFactory();
this.UNREALIZED = videoBroadcastConstants.state.UNREALIZED;
this.CONNECTING = videoBroadcastConstants.state.CONNECTING;
@@ -22,21 +22,21 @@
this.timerManager = new TimerManager();
this.timeout = this.timerManager.createTimer.bind(this.timerManager);
// this.transitions = null;
- },
-
- assertNotUndefined : function(elmt) {
- return elmt;
- },
-
- assertEquals: function(elmt1, elmt2) {
+ }
+
+ assertNotUndefined(elmt) {
+ return elmt;
+ }
+
+ assertEquals(elmt1, elmt2) {
return elmt1 == elmt2;
- },
-
- assertNotNull: function(elmt) {
+ }
+
+ assertNotNull(elmt) {
return elmt;
- },
-
- waitForError: function(callback, resolve) {
+ }
+
+ waitForError(callback, resolve) {
new Promise(function(resolve, reject) {
callback();
})
@@ -44,51 +44,50 @@
console.log(val);
resolve();
});
- },
-
- addTransition: function(begin, end, callback) {
+ }
+
+ addTransition(begin, end, callback) {
this.addTransitionWithError(begin, end, null, callback);
- },
-
- addTransitionWithError: function(begin, end, error, callback) {
+ }
+
+ addTransitionWithError(begin, end, error, callback) {
this.transitions.push({
begin: begin,
end: end,
error: error,
callback: callback
});
- },
-
+ }
+
/*
- *
+ *
* @param {type} resolve
* @param {type} reject
* @param {type} newState
* @param {type} errorCode
* @returns {undefined}
- * FIXME: Yannis - 01/04/2015 - The verification done in else clause
+ * FIXME: Yannis - 01/04/2015 - The verification done in else clause
* could be reviewed.
*/
- onChangeState: function(resolve, reject, newState, errorCode) {
+ onChangeState(resolve, reject, newState, errorCode) {
var currentTransition = this.transitions[this.currentIndex];
var begin = currentTransition.begin;
var end = currentTransition.end;
- var error = currentTransition.error;
+ var error = currentTransition.error;
console.log(this.vidBroadObj.playState);
+
if (begin == this.previousState && end == newState && error == errorCode) {
currentTransition.callback && currentTransition.callback();
this.previousState = newState;
this.currentIndex++;
} else {
- //
- if (begin == this.CONNECTING
- && this.transitions.length == this.currentIndex + 1) {
+ if (begin == this.CONNECTING && this.transitions.length == this.currentIndex + 1) {
reject("Untestable case for the moment.");
} else {
reject("Invalid state.");
}
}
}
-
-});
+}
+
Modified: oipf/test/js/TestConfig.js
===================================================================
--- oipf/test/js/TestConfig.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/TestConfig.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -5,9 +5,10 @@
*/
if (!String.prototype.includes) {
- String.prototype.includes = function() {'use strict';
- return String.prototype.indexOf.apply(this, arguments) !== -1;
- };
+ String.prototype.includes = function() {
+ "use strict";
+ return String.prototype.indexOf.apply(this, arguments) !== -1;
+ };
}
var userAgent = navigator.userAgent;
@@ -22,22 +23,32 @@
!ui.visible && ui.show();
ui.activate();
- var VideoBroadcastManager = VideoBroadcastTest.extend({
+ class VideoBroadcastManager extends VideoBroadcastTest {
- init: function() {
+ constructor() {
// this.superBeforeTest = VideoBroadcastTest.prototype.super.beforeTest;
+
+ this.startEndStates = {
+
+ "00": "unrealizedToUnrealized",
+ "01": "unrealizedToConnecting",
+ "12": "connectingToPresenting",
+ "33": "stopToStop",
+ "nullnull": "noStatesDefined"
+ };
+
this.vidBroadObj = oipfObjectFactory.createVideoBroadcastObject();
- this.superBeforeTest = this.super.beforeTest;
- this.superOnChangeState = this.super.onChangeState;
- },
+ this.superBeforeTest = this.beforeTest;
+ this.superOnChangeState = this.onChangeState;
+ }
- onChangeState: function(resolve, reject, event) {
+ onChangeState(resolve, reject, event) {
this.superOnChangeState.call(this,
resolve, reject, event.state, event.error);
- },
+ }
- beforeTest: function(resolve, reject) {
+ beforeTest(resolve, reject) {
this.onPlayStateChange = this.onChangeState.bind(this, resolve, reject);
this.vidBroadObj.addEventListener("PlayStateChange", this.onPlayStateChange, false);
this.transitions = [];
@@ -46,17 +57,17 @@
this.channel = null;
this.timerManager = new TimerManager();
this.timeout = this.timerManager.createTimer.bind(this.timerManager);
- logTest("State: Pending");
+ OipfUtils.logTest("State: Pending");
this.cancel = true;
- },
+ }
- unrealizedToConnecting: function(begin, end, callback) {
+ unrealizedToConnecting(begin, end, callback) {
if (callback) {
- throw ("Untestable Case.");
+ throw "Untestable Case.";
}
- },
+ }
- connectingToPresenting: function(begin, end, callback) {
+ connectingToPresenting(begin, end, callback) {
/**
* Avoid that the future transition C->P be canceled.
* More extend super method beforeTest in order to reset
@@ -68,86 +79,87 @@
} else {
this.pushTransition(begin, end, callback, null);
}
- },
+ }
- unrealizedToUnrealized: function(begin, end, callback) {
+ unrealizedToUnrealized(begin, end, callback) {
this.reject("Untestable Case.");
- },
+ }
- stopToStop: function(begin, end, callback) {
+ stopToStop(begin, end, callback) {
this.reject("Untestable Case.");
- },
+ }
- noStatesDefined: function(begin, end, callback) {
+ noStatesDefined(begin, end, callback) {
this.reject("Untestable Case.");
- },
+ }
- startEndStates: {
-
- "00": "unrealizedToUnrealized",
- "01": "unrealizedToConnecting",
- "12": "connectingToPresenting",
- "33": "stopToStop",
- "nullnull": "noStatesDefined"
- },
-
- pushTransition: function(begin, end, callback, error) {
+ pushTransition(begin, end, callback, error) {
this.transitions.push({
begin: begin,
end: end,
error: error,
callback: callback
});
- },
+ }
- pushTransitionWithError: function(begin, end, callback, error) {
- var method = this.startEndStates[""+begin+end];
+ pushTransitionWithError(begin, end, callback, error) {
+ var method = this.startEndStates["" + begin + end];
if (method) {
this[method].call(this, begin, end, callback);
} else {
this.pushTransition(begin, end, callback, error);
}
- },
+ }
- addTransition: function(begin, end, callback) {
+ addTransition(begin, end, callback) {
this.addTransitionWithError(begin, end, callback, null);
- },
+ }
- addTransitionWithError: function(begin, end, callback, error) {
+ addTransitionWithError(begin, end, callback, error) {
this.pushTransitionWithError(begin, end, callback, error);
}
- });
+ }
- var VideoBroadcastTest = VideoBroadcastManager.extend({
+ class VideoBroadcastTest extends VideoBroadcastManager {
- init: function() {
- this.super.init();
+ constructor() {
+ super();
}
- });
-
- var SearchManagerTest = SearchManagerTest.extend({
- init: function() {
+ }
+
+ class SearchManagerTest extends SearchManagerTest {
+
+ constructor() {
+ super();
+
+ startEndStates = {
+ "00": "unrealizedToUnrealized",
+ "01": "unrealizedToConnecting",
+ "12": "connectingToPresenting",
+ "33": "stopToStop",
+ "nullnull": "noStatesDefined"
+ };
+
this.searchManagerObj = oipfObjectFactory.createSearchManagerObject();
- this.super.init();
- },
-
- beforeTest: function(resolve, reject) {
- this.super.beforeTest(resolve, reject);
+ }
+
+ beforeTest(resolve, reject) {
+ this.beforeTest(resolve, reject);
this.cancel = true;
- },
-
- noStatesDefined: function(begin, end, callback) {
+ }
+
+ noStatesDefined(begin, end, callback) {
this.reject("Untestable Case.");
- },
-
- unrealizedToConnecting: function(begin, end, callback) {
+ }
+
+ unrealizedToConnecting(begin, end, callback) {
if (callback) {
- throw ("Untestable Case.");
+ throw "Untestable Case.";
}
- },
+ }
- connectingToPresenting: function(begin, end, callback) {
+ connectingToPresenting(begin, end, callback) {
/**
* Avoid that the future transition C->P be canceled.
* More extend super method beforeTest in order to reset
@@ -159,48 +171,39 @@
} else {
this.pushTransition(begin, end, callback, null);
}
- },
-
- startEndStates: {
+ }
- "00": "unrealizedToUnrealized",
- "01": "unrealizedToConnecting",
- "12": "connectingToPresenting",
- "33": "stopToStop",
- "nullnull": "noStatesDefined"
- },
-
- pushTransition: function(begin, end, callback, error) {
+ pushTransition(begin, end, callback, error) {
this.transitions.push({
begin: begin,
end: end,
error: error,
callback: callback
});
- },
+ }
- pushTransitionWithError: function(begin, end, callback, error) {
- var method = this.startEndStates[""+begin+end];
+ pushTransitionWithError(begin, end, callback, error) {
+ var method = this.startEndStates["" + begin + end];
if (method) {
this[method].call(this, begin, end, callback);
} else {
this.pushTransition(begin, end, callback, error);
}
- },
+ }
- addTransition: function(begin, end, callback) {
+ addTransition(begin, end, callback) {
this.addTransitionWithError(begin, end, callback, null);
- },
+ }
- addTransitionWithError: function(begin, end, callback, error) {
+ addTransitionWithError(begin, end, callback, error) {
this.pushTransitionWithError(begin, end, callback, error);
}
- });
+ }
- var RecordingSchedulerTest = RecordingSchedulerTest.extend({
+ class RecordingSchedulerTest extends RecordingSchedulerTest {
- init: function() {
- this.super.init();
+ constructor() {
+ super();
this.blocked = function() {};
this.bindToCurrentChannel = this.blocked;
this.onChangeState = this.blocked;
@@ -209,18 +212,18 @@
this.vidBroadObj = oipfObjectFactory.createVideoBroadcastObject();
}
}
- },
+ }
- onPVREvent: function(resolve, reject, event) {
+ onPVREvent(resolve, reject, event) {
console.log("beforeTest");
- this.super.onPVREvent(resolve, reject, event.state, event.recording);
- },
+ this.onPVREvent(resolve, reject, event.state, event.recording);
+ }
- beforeTest: function(resolve, reject) {
+ beforeTest(resolve, reject) {
console.log("beforeTest");
- this.super.beforeTest(resolve, reject);
+ this.beforeTest(resolve, reject);
}
- });
+ }
}
Modified: oipf/test/js/VideoBroadcastTest.js
===================================================================
--- oipf/test/js/VideoBroadcastTest.js 2015-06-10 11:54:56 UTC (rev 1686)
+++ oipf/test/js/VideoBroadcastTest.js 2015-06-10 11:58:23 UTC (rev 1687)
@@ -3,43 +3,33 @@
* This class gather a set of method necessary to test a video broadcast object.
*
*/
-var VideoBroadcastTest = TestCase.extend({
- channel: null,
-
- UNREALIZED: 0,
-
- CONNECTING: 1,
-
- PRESENTING: 2,
-
- STOPPED: 3,
-
- vidBroadObj: null,
-
- errorMap: {
-
- 0: "Channel not supported by tuner.",
- 1: "Cannot tune to given transport stream (e.g. no signal).",
- 2: "Tuner locked by other object.",
- 3: "Parental lock on channel.",
- 4: "Encrypted channel, key/module missing.",
- 5: "Unknown channel (e.g. can’t resolve DVB or ISDB triplet).",
- 6: "Channel switch interrupted (e.g. because another channel switch was activated before the previous one completed).",
- 7: "Channel cannot be changed, because it is currently being recorded.",
- 8: "Cannot resolve URI of referenced IP channel.",
- 9: "Insufficient bandwidth.",
- 10: "Channel cannot be changed by nextChannel()/prevChannel() methods either because the OITF does not maintain a favourites or channel list or because the video/broadcast object is in the Unrealized state.",
- 11: "Insufficient resources are available to present the given channel (e.g. a lack of available codec resources).",
- 12: "Specified channel not found in transport stream.",
- 100: "Unidentified error."
-
- },
-
- init: function() {
- this.super.init();
- },
-
- beforeTest: function(resolve, reject) {
+class VideoBroadcastTest extends TestCase {
+
+ constructor() {
+ super();
+ this.channel = null;
+
+ this.vidBroadObj = null;
+
+ this.errorMap = {
+ 0: "Channel not supported by tuner.",
+ 1: "Cannot tune to given transport stream (e.g. no signal).",
+ 2: "Tuner locked by other object.",
+ 3: "Parental lock on channel.",
+ 4: "Encrypted channel, key/module missing.",
+ 5: "Unknown channel (e.g. can’t resolve DVB or ISDB triplet).",
+ 6: "Channel switch interrupted (e.g. because another channel switch was activated before the previous one completed).",
+ 7: "Channel cannot be changed, because it is currently being recorded.",
+ 8: "Cannot resolve URI of referenced IP channel.",
+ 9: "Insufficient bandwidth.",
+ 10: "Channel cannot be changed by nextChannel()/prevChannel() methods either because the OITF does not maintain a favourites or channel list or because the video/broadcast object is in the Unrealized state.",
+ 11: "Insufficient resources are available to present the given channel (e.g. a lack of available codec resources).",
+ 12: "Specified channel not found in transport stream.",
+ 100: "Unidentified error."
+ };
+ }
+
+ beforeTest(resolve, reject) {
this.vidBroadObj = oipfObjectFactory.createVideoBroadcastObject();
this.onPlayStateChange = this.onChangeState.bind(this, resolve, reject);
this.vidBroadObj.addEventListener("PlayStateChange", this.onPlayStateChange, false);
@@ -47,37 +37,37 @@
this.previousState = this.vidBroadObj.playState;
this.currentIndex = 0;
this.channel = null;
- logTest("State: Pending");
- },
-
- afterTest: function() {
+ OipfUtils.logTest("State: Pending");
+ }
+
+ afterTest() {
// this.vidBroadObj.release(); //Useful for test on tv plateform
this.vidBroadObj.removeEventListener("PlayStateChange", this.onPlayStateChange);
this.timerManager.clearTimer();
- },
-
- getChannel: function(channelCollection){
+ }
+
+ getChannel(channelCollection) {
if (channelCollection.length != 0) {
return channelCollection[0];
}
return null;
- },
-
+ }
+
// /*
-// *
+// *
// * @param {type} resolve
// * @param {type} reject
// * @param {type} newState
// * @param {type} errorCode
// * @returns {undefined}
-// * FIXME: Yannis - 01/04/2015 - The verification done in else clause
+// * FIXME: Yannis - 01/04/2015 - The verification done in else clause
// * could be reviewed.
// */
-// onChangeState: function(resolve, reject, newState, errorCode) {
+// onChangeState(resolve, reject, newState, errorCode) {
// var currentTransition = this.transitions[this.currentIndex];
// var begin = currentTransition.begin;
// var end = currentTransition.end;
-// var error = currentTransition.error;
+// var error = currentTransition.error;
// console.log(this.vidBroadObj.playState);
// if (begin == this.previousState && end == newState && error == errorCode) {
// currentTransition.callback && currentTransition.callback();
@@ -85,245 +75,245 @@
// this.currentIndex++;
// } else {
// //
-// if (begin == this.CONNECTING
+// if (begin == this.CONNECTING
// && this.transitions.length == this.currentIndex + 1) {
// reject("Untestable case for the moment.");
// } else {
// reject("Invalid state");
// }
// }
-// },
-
+// }
+
/*
* This method must throw a error by using the method reject.
- *
+ *
* @param {type} resolve
* @param {type} reject
* @returns {undefined}
*/
- testBindToCurrentChannelWhenNoChannelPresentation: function(resolve, reject) {
+ testBindToCurrentChannelWhenNoChannelPresentation(resolve, reject) {
//Subject to modification not rigth way failed on the tv plateform.
this.vidBroadObj._channelService.currentChannel = null;
-
+
this.addTransitionWithError(this.UNREALIZED, this.UNREALIZED, 100, resolve);
this.vidBroadObj.bindToCurrentChannel();
- },
-
+ }
+
/*
* Descrtiption:
* This method test the binding between the video broadcast object and the current program stream.
* ToDO: Extraction of method onPlayStateChange out.
*/
-// testBindToCurrentChannel: function(resolve, reject) {
+// testBindToCurrentChannel(resolve, reject) {
// var self = this;
//
// this.addTransition(this.previousState, this.PRESENTING);
-//
+//
// this.vidBroadObj.bindToCurrentChannel();
-// },
-
- testDoubleBindToCurrentChannel: function(resolve, reject) {
+// }
+ testDoubleBindToCurrentChannel(resolve, reject) {
+
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testBindToCurrentChannelInConnecting: function(resolve, reject) {
+ }
+
+ testBindToCurrentChannelInConnecting(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING, function() {
self.vidBroadObj.bindToCurrentChannel();
});
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testBindToCurrentChannelInPresenting: function(resolve, reject) {
+ }
+
+ testBindToCurrentChannelInPresenting(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.bindToCurrentChannel();
resolve();
});
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testBindToCurrentChannelInStopped: function(resolve, reject) {
+ }
+
+ testBindToCurrentChannelInStopped(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.stop();
});
-
+
this.addTransition(this.PRESENTING, this.STOPPED, function() {
self.vidBroadObj.bindToCurrentChannel();
});
-
+
this.addTransition(this.STOPPED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
-
- },
-
+
+ }
+
/*
* This method must throw a error by using the method reject.
* @param {type} resolve
* @param {type} reject
* @returns {undefined}
*/
- testBindToCurrentChannelInStoppedWhenNoTuner: function(resolve, reject) {
+ testBindToCurrentChannelInStoppedWhenNoTuner(resolve, reject) {
var self = this;
-
+
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.stop();
});
-
+
this.addTransition(this.PRESENTING, this.STOPPED, function() {
- //We want test the case where the current channel has a idType whose
+ //We want test the case where the current channel has a idType whose
//any tuner supporting this kind of channel exist.
//So we create channel of idType "ATSCT".
self.vidBroadObj._channelService.currentChannel = new Channel(ID_ATSC_T, null, null);
self.vidBroadObj.bindToCurrentChannel();
});
-
+
this.addTransitionWithError(this.STOPPED, this.STOPPED, 0, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
+ }
- testPrevChannelInUnrealized: function(resolve, reject) {
+ testPrevChannelInUnrealized(resolve, reject) {
this.addTransition(null, null, reject);
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
reject();
};
this.vidBroadObj.prevChannel();
this.timeout(3000).then(resolve);
-
- },
-
- testPrevChannelInConnecting: function(resolve, reject) {
+
+ }
+
+ testPrevChannelInConnecting(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING, function() {
self.vidBroadObj.prevChannel();
});
this.addTransition(this.CONNECTING, this.CONNECTING);
-
+
this.addTransition(this.PRESENTING, this.CONNECTING);
-
+
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
if (self.assertNotNull(channel) && self.assertEquals(this.vidBroadObj, this.PRESENTING)) {
- logTest("State: Successful");
+ OipfUtils.logTest("State: Successful");
resolve();
} else {
- logTest("State: Failure");
+ OipfUtils.logTest("State: Failure");
reject("Failure : The channel is null for a unknown reason or wrong play state.");
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testPrevChannelInPresenting: function(resolve, reject) {
+ }
+
+ testPrevChannelInPresenting(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.prevChannel();
});
-
+
this.addTransition(this.PRESENTING, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING);
-
+
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
if (self.assertNotNull(channel) && self.assertEquals(this.vidBroadObj, this.PRESENTING)) {
- logTest("State: Successful");
+ OipfUtils.logTest("State: Successful");
resolve("Successfull");
} else {
- logTest("State: Failure");
+ OipfUtils.logTest("State: Failure");
reject("Failure : The channel is null for a unknown reason or wrong play state.");
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testPrevChannelInStopped: function(resolve, reject) {
+ }
+
+ testPrevChannelInStopped(resolve, reject) {
var self = this;
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.stop();
});
-
+
this.addTransition(this.PRESENTING, this.STOPPED, function() {
self.vidBroadObj.prevChannel();
});
-
+
this.addTransition(this.STOPPED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING);
-
+
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
if (self.assertNotNull(channel) && self.assertEquals(this.vidBroadObj, this.PRESENTING)) {
- logTest("State: Successful");
+ OipfUtils.logTest("State: Successful");
resolve("Successfull");
} else {
- logTest("State: Failure");
+ OipfUtils.logTest("State: Failure");
reject("Failure : The channel is null for a unknown reason or wrong play state.");
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
-// testPrevChannel: function(resolve, reject) {
+ }
+
+// testPrevChannel(resolve, reject) {
// var self = this;
-//
+//
// this.addTransition(this.PRESENTING, this.CONNECTING);
//
// this.addTransition(this.CONNECTING, this.PRESENTING);
-//
+//
// this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
//
// if (self.assertNotNull(channel) && self.assertEquals(this.vidBroadObj, this.PRESENTING)) {
-// logTest("State: Successful");
+// OipfUtils.logTest("State: Successful");
// resolve("Successfull");
// } else {
-// logTest("State: Failure");
+// OipfUtils.logTest("State: Failure");
// reject("Failure : The channel is null for a unknown reason or wrong play state.");
// }
// };
-//
+//
// this.vidBroadObj.prevChannel();
//
-// },
-
- testNextChannelInUnrealized: function(resolve, reject) {
+// }
+
+ testNextChannelInUnrealized(resolve, reject) {
this.addTransition(null, null, reject);
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
reject();
@@ -331,130 +321,130 @@
this.vidBroadObj.nextChannel();
this.timeout(3000)
.then(resolve);
- },
-
- testNextChannelInConnecting: function(resolve, reject) {
+ }
+
+ testNextChannelInConnecting(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING, function() {
self.vidBroadObj.nextChannel();
});
this.addTransition(this.CONNECTING, this.CONNECTING);
-
+
this.addTransition(this.PRESENTING, this.CONNECTING);
-
+
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
if (self.assertNotNull(channel) && self.assertEquals(this.vidBroadObj, this.PRESENTING)) {
- logTest("State: Successful");
+ OipfUtils.logTest("State: Successful");
resolve("Successfull");
} else {
- logTest("State: Failure");
+ OipfUtils.logTest("State: Failure");
reject("Failure : The channel is null for a unknown reason or wrong play state.");
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testNextChannelInPresenting: function(resolve, reject) {
+ }
+
+ testNextChannelInPresenting(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.nextChannel();
});
-
+
this.addTransition(this.PRESENTING, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING);
-
+
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
if (self.assertNotNull(channel) && self.assertEquals(this.vidBroadObj, this.PRESENTING)) {
- logTest("State: Successful");
+ OipfUtils.logTest("State: Successful");
resolve("Successfull");
} else {
- logTest("State: Failure");
+ OipfUtils.logTest("State: Failure");
reject("Failure : The channel is null for a unknown reason or wrong play state.");
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testNextChannelInStopped: function(resolve, reject) {
+ }
+
+ testNextChannelInStopped(resolve, reject) {
var self = this;
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.stop();
});
-
+
this.addTransition(this.PRESENTING, this.STOPPED, function() {
self.vidBroadObj.nextChannel();
});
-
+
this.addTransition(this.STOPPED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING);
-
+
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
if (self.assertNotNull(channel) && self.assertEquals(this.vidBroadObj, this.PRESENTING)) {
- logTest("State: Successful");
+ OipfUtils.logTest("State: Successful");
resolve("Successfull");
} else {
- logTest("State: Failure");
+ OipfUtils.logTest("State: Failure");
reject("Failure : The channel is null for a unknown reason or wrong play state.");
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
-// testNextChannel: function(resolve, reject) {
+ }
+
+// testNextChannel(resolve, reject) {
// var self = this;
-//
+//
// this.addTransition(this.PRESENTING, this.CONNECTING);
//
// this.addTransition(this.CONNECTING, this.PRESENTING);
-//
+//
// this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
//
// if (self.assertNotNull(channel) && self.assertEquals(this.vidBroadObj, this.PRESENTING)) {
-// logTest("State: Successful");
+// OipfUtils.logTest("State: Successful");
// resolve("Successfull");
// } else {
-// logTest("State: Failure");
+// OipfUtils.logTest("State: Failure");
// reject("Failure : The channel is null for a unknown reason or wrong play state.");
// }
// };
-//
+//
// this.vidBroadObj.nextChannel();
-// },
-
+// }
+
/*
* Description:
* Nominal Case
*/
- testReleaseInConnecting: function(resolve, reject) {
+ testReleaseInConnecting(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING, function() {
self.vidBroadObj.release();
});
-
+
this.addTransition(this.CONNECTING, this.UNREALIZED, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testReleaseInPresenting: function(resolve, reject) {
+ }
+
+ testReleaseInPresenting(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
@@ -462,50 +452,50 @@
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.release();
});
-
+
this.addTransition(this.PRESENTING, this.UNREALIZED, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
+ }
+
/*
- * Description:
+ * Description:
* Method stop is called in presenting state(but can be also in connecting state).
* @param {type} resolve
* @param {type} reject
* @returns {undefined}
*/
- testReleaseInStopped: function(resolve, reject) {
+ testReleaseInStopped(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
-
+
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.stop();
});
-
+
this.addTransition(this.PRESENTING, this.STOPPED, function() {
self.vidBroadObj.release();
});
-
+
this.addTransition(this.STOPPED, this.UNREALIZED, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
-// testRelease: function(resolve, reject) {
+ }
+
+// testRelease(resolve, reject) {
// var self = this;
-//
+//
// this.addTransition(this.PRESENTING, this.UNREALIZED, resolve);
-//
+//
// this.vidBroadObj.release();
-// },
-
+// }
+
/*
* Description:
* Nominal Case
*/
- testStopInConnecting: function(resolve, reject) {
+ testStopInConnecting(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING, function() {
@@ -513,11 +503,11 @@
});
this.addTransition(this.CONNECTING, this.STOPPED, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testStopInPresenting: function(resolve, reject) {
+ }
+
+ testStopInPresenting(resolve, reject) {
var self = this;
this.addTransition(this.UNREALIZED, this.CONNECTING);
@@ -525,300 +515,300 @@
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.stop();
});
-
+
this.addTransition(this.PRESENTING, this.STOPPED, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
-// testStop: function(resolve, reject) {
+ }
+
+// testStop(resolve, reject) {
// var self = this;
-//
+//
// this.addTransition(this.PRESENTING, this.STOPPED, resolve);
-//
+//
// this.vidBroadObj.stop();
-// },
-
+// }
+
/*
* Description:
* Nominal Case
*/
- testSetVolume: function(resolve, reject) {
+ testSetVolume(resolve, reject) {
var volume = 15;
var done = this.vidBroadObj.setVolume(volume);
-
+
if (done && this.assertEquals(volume, this.vidBroadObj.getVolume())) {
resolve();
} else {
reject();
- }
- },
-
- testSetVolumeWithoutArgument: function(resolve, reject) {
+ }
+ }
+
+ testSetVolumeWithoutArgument(resolve, reject) {
var done = this.vidBroadObj.setVolume();
-
+
if (done) {
reject();
} else {
resolve();
- }
- },
-
- testSetVolumeWithFloatArgument: function(resolve, reject) {
+ }
+ }
+
+ testSetVolumeWithFloatArgument(resolve, reject) {
var volume = 15.8;
var done = this.vidBroadObj.setVolume(volume);
-
+
if (done || this.assertEquals(volume, this.vidBroadObj.getVolume())) {
reject("[Stub]Wrong Implementation.");
} else {
resolve();
- }
- },
-
- testSetVolumeWithFloatUnderBoundMin: function(resolve, reject) {
+ }
+ }
+
+ testSetVolumeWithFloatUnderBoundMin(resolve, reject) {
var volume = -15.8;
var done = this.vidBroadObj.setVolume(volume);
-
+
if (done || this.assertEquals(volume, this.vidBroadObj.getVolume())) {
reject("[Stub]Wrong Implementation.");
} else {
resolve();
- }
- },
-
- testSetVolumeWithFloatAboveBoundMax: function(resolve, reject) {
+ }
+ }
+
+ testSetVolumeWithFloatAboveBoundMax(resolve, reject) {
var volume = 151.74;
var done = this.vidBroadObj.setVolume(volume);
-
+
if (done || this.assertEquals(volume, this.vidBroadObj.getVolume())) {
reject("[Stub]Wrong Implementation.");
} else {
resolve();
- }
- },
-
- testSetVolumeWithValueUnderBoundMin: function(resolve, reject) {
+ }
+ }
+
+ testSetVolumeWithValueUnderBoundMin(resolve, reject) {
var volume = -15;
var done = this.vidBroadObj.setVolume(volume);
-
+
if (done && this.assertEquals(volume, this.vidBroadObj.getVolume())) {
reject();
} else {
resolve();
- }
- },
-
- testSetVolumeWithValueAboveBoundMax: function(resolve, reject) {
+ }
+ }
+
+ testSetVolumeWithValueAboveBoundMax(resolve, reject) {
var volume = 105;
var done = this.vidBroadObj.setVolume(volume);
-
+
if (done && this.assertEquals(volume, this.vidBroadObj.getVolume())) {
reject();
} else {
resolve();
- }
- },
-
-// testSetVolume: function(resolve, reject) {
+ }
+ }
+
+// testSetVolume(resolve, reject) {
// var volume = 15;
-//
+//
// var done = this.vidBroadObj.setVolume(volume);
-//
+//
// if (done) {
// resolve();
// } else {
// reject();
// }
-// },
-
+// }
+
/*
* Description:
* Nominal Case
* FIX-ME: Yannis - 24/03/2015 - Exception not throw in callback of method addTransition
*/
- testGetVolume: function(resolve, reject) {
- var initialVolume = 15;
- var done = this.vidBroadObj.setVolume(initialVolume);
-
+ testGetVolume(resolve, reject) {
+ var constructorialVolume = 15;
+ var done = this.vidBroadObj.setVolume(constructorialVolume);
+
var finalVolume = this.vidBroadObj.getVolume();
- if (done && this.assertEquals(initialVolume, this.vidBroadObj.getVolume())
- && this.assertEquals(initialVolume, finalVolume)
+ if (done && this.assertEquals(constructorialVolume, this.vidBroadObj.getVolume())
+ && this.assertEquals(constructorialVolume, finalVolume)
&& this.assertEquals(this.vidBroadObj.getVolume(), finalVolume)) {
resolve();
} else {
reject();
- }
- },
-
-// testGetVolume: function(resolve, reject) {
+ }
+ }
+
+// testGetVolume(resolve, reject) {
// var volume = this.vidBroadObj.getVolume();
-//
+//
// if (volume ) {
// resovle();
// } else {
// reject();
// }
-// },
- testSetChannelInUnrealized: function(resolve, reject) {
+// }
+ testSetChannelInUnrealized(resolve, reject) {
var self = this;
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.setChannel(self.channel);
});
-
+
this.addTransition(this.PRESENTING, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING);
-
+
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
if (self.assertNotNull(channel) && self.assertEquals(self.vidBroadObj.playState, self.PRESENTING)) {
- logTest("State: Successful");
+ OipfUtils.logTest("State: Successful");
resolve("Success");
} else {
- logTest("State: Failure");
+ OipfUtils.logTest("State: Failure");
reject("Failure : The channel is null for a unknown reason or wrong play state.");
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
+ }
- testSetChannelInConnecting: function(resolve, reject) {
+ testSetChannelInConnecting(resolve, reject) {
var self = this;
-
+
this.channel = this.getChannel(
this.vidBroadObj.getChannelConfig().channelList);
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING, function() {
self.vidBroadObj.setChannel(self.channel);
});
this.addTransition(this.CONNECTING, this.PRESENTING);
-
+
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
if (self.assertNotNull(channel) && self.assertEquals(self.vidBroadObj.playState, self.PRESENTING)) {
- logTest("State: Successful");
+ OipfUtils.logTest("State: Successful");
resolve("Success");
} else {
- logTest("State: Failure");
+ OipfUtils.logTest("State: Failure");
reject("Failure : The channel is null for a unknown reason or wrong play state.");
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testSetChannelInConnectingWithNull: function(resolve, reject) {
+ }
+
+ testSetChannelInConnectingWithNull(resolve, reject) {
var self = this;
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING, function() {
self.vidBroadObj.setChannel(null);
});
this.addTransition(this.CONNECTING, this.UNREALIZED, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testSetChannelInPresenting: function(resolve, reject) {
+ }
+
+ testSetChannelInPresenting(resolve, reject) {
var self = this;
-
+
this.channel = this.getChannel(
this.vidBroadObj.getChannelConfig().channelList);
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.setChannel(self.channel);
});
-
+
this.addTransition(this.PRESENTING, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING);
-
+
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
if (self.assertNotNull(channel) && self.assertEquals(self.vidBroadObj.playState, self.PRESENTING)) {
- logTest("State: Successful");
+ OipfUtils.logTest("State: Successful");
resolve("Success");
} else {
- logTest("State: Failure");
+ OipfUtils.logTest("State: Failure");
reject("Failure : The channel is null for a unknown reason or wrong play state.");
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testSetChannelInPresentingWithNull: function(resolve, reject) {
+ }
+
+ testSetChannelInPresentingWithNull(resolve, reject) {
var self = this;
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.setChannel(null);
});
-
+
this.addTransition(this.PRESENTING, this.UNREALIZED, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
-
- },
-
- testSetChannelInStopped: function(resolve, reject) {
+
+ }
+
+ testSetChannelInStopped(resolve, reject) {
var self = this;
-
+
this.channel = this.getChannel(
this.vidBroadObj.getChannelConfig().channelList);
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.stop();
});
-
+
this.addTransition(this.PRESENTING, this.STOPPED, function() {
self.vidBroadObj.setChannel(self.channel);
});
-
+
this.addTransition(this.STOPPED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING);
-
+
this.vidBroadObj.onChannelChangeSucceeded = function(channel) {
if (self.assertNotNull(channel) && self.assertEquals(self.vidBroadObj.playState, self.PRESENTING)) {
- logTest("State: Successful");
+ OipfUtils.logTest("State: Successful");
resolve("Success");
} else {
- logTest("State: Failure");
+ OipfUtils.logTest("State: Failure");
reject("Failure : The channel is null for a unknown reason or wrong play state.");
}
};
-
+
this.vidBroadObj.bindToCurrentChannel();
- },
-
- testSetChannelInStoppedWithNull: function(resolve, reject) {
+ }
+
+ testSetChannelInStoppedWithNull(resolve, reject) {
var self = this;
-
+
this.addTransition(this.UNREALIZED, this.CONNECTING);
this.addTransition(this.CONNECTING, this.PRESENTING, function() {
self.vidBroadObj.stop();
});
-
+
this.addTransition(this.PRESENTING, this.STOPPED, function() {
self.vidBroadObj.setChannel(null);
});
-
+
this.addTransition(this.STOPPED, this.UNREALIZED, resolve);
-
+
this.vidBroadObj.bindToCurrentChannel();
-
+
}
-
-});
\ No newline at end of file
+
+}
1
0
Author: ygrego
Date: 2015-06-10 11:54:56 +0000 (Wed, 10 Jun 2015)
New Revision: 1686
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1686
Log:
The method 'createUUID' has been moved to class OipfUtils.
Modified:
oipf/lib/js/utils/ProgrammeHelper.js
Modified: oipf/lib/js/utils/ProgrammeHelper.js
===================================================================
--- oipf/lib/js/utils/ProgrammeHelper.js 2015-06-10 09:15:31 UTC (rev 1685)
+++ oipf/lib/js/utils/ProgrammeHelper.js 2015-06-10 11:54:56 UTC (rev 1686)
@@ -75,7 +75,7 @@
createProgramme(object, programme);
programme.channel = this.initChannel(channelName);
- programme.programmeID = createUUID();
+ programme.programmeID = OipfUtils.createUUID();
var programmeObject = new Programme(programme);
this.programmes.push(programmeObject);
}
1
0
Author: ygrego
Date: 2015-06-10 09:15:31 +0000 (Wed, 10 Jun 2015)
New Revision: 1685
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1685
Log:
Use of OipfUtils's statics methods.
Modified:
oipf/lib/js/utils/ChannelService.js
oipf/lib/js/utils/EventManager.js
Modified: oipf/lib/js/utils/ChannelService.js
===================================================================
--- oipf/lib/js/utils/ChannelService.js 2015-06-10 09:11:38 UTC (rev 1684)
+++ oipf/lib/js/utils/ChannelService.js 2015-06-10 09:15:31 UTC (rev 1685)
@@ -11,7 +11,7 @@
this.channelOrigin = channelOrigin;
this.channelListArray = channelList;
- this.getNumber = oipf.utils.generateFourDigit.bind(null);
+ this.getNumber = OipfUtils.generateFourDigit.bind(null);
this.channelList = new ChannelList();
this.createChannelList();
Modified: oipf/lib/js/utils/EventManager.js
===================================================================
--- oipf/lib/js/utils/EventManager.js 2015-06-10 09:11:38 UTC (rev 1684)
+++ oipf/lib/js/utils/EventManager.js 2015-06-10 09:15:31 UTC (rev 1685)
@@ -24,7 +24,7 @@
listeners && listeners.forEach(function(listener) {
console.log(">>fireEvent");
- oipf.utils.timeout(0)
+ OipfUtils.timeout(0)
.then(listener.apply.bind(listener, target, event.detail));
});
1
0
Author: ygrego
Date: 2015-06-10 09:11:38 +0000 (Wed, 10 Jun 2015)
New Revision: 1684
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1684
Log:
Take into account the deletion of file 'Utils.js' and the addition of new file 'OipfUtils.js'.
Modified:
oipf/lib/paths.json
Modified: oipf/lib/paths.json
===================================================================
--- oipf/lib/paths.json 2015-06-10 09:04:42 UTC (rev 1683)
+++ oipf/lib/paths.json 2015-06-10 09:11:38 UTC (rev 1684)
@@ -11,7 +11,7 @@
"js/utils/Timeout.js",
"js/utils/Calculation.js",
"js/utils/ChannelUtils.js",
- "js/utils/Utils.js",
+ "js/utils/OipfUtils.js",
"js/utils/EventManager.js",
"js/utils/TimerManager.js",
"js/utils/TimerRecordingManager.js",
1
0
Author: ygrego
Date: 2015-06-10 09:04:42 +0000 (Wed, 10 Jun 2015)
New Revision: 1683
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1683
Log:
Refactoring of file ChannelUtils.js in an ES6 class.
Modified:
oipf/lib/js/impl/RecordingSchedulerObject.js
oipf/lib/js/impl/VideoBroadcastObject.js
oipf/lib/js/impl/model/Application.js
oipf/lib/js/impl/model/Channel.js
oipf/lib/js/impl/model/Configuration.js
oipf/lib/js/impl/model/LNBInfo.js
oipf/lib/js/impl/model/LocalSystem.js
oipf/lib/js/impl/model/ModelFactory.js
oipf/lib/js/impl/model/Programme.js
oipf/lib/js/impl/model/Recording.js
oipf/lib/js/impl/model/ScheduledRecording.js
oipf/lib/js/impl/model/SearchResults.js
oipf/lib/js/impl/model/SignalInfo.js
oipf/lib/js/impl/model/Tuner.js
oipf/lib/js/utils/ChannelUtils.js
Modified: oipf/lib/js/impl/RecordingSchedulerObject.js
===================================================================
--- oipf/lib/js/impl/RecordingSchedulerObject.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/RecordingSchedulerObject.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -275,7 +275,7 @@
}
_fireEvent(state, recording) {
- var event = createCustomEvent("PVREvent", [state, recording]);
+ var event = this._eventManager.createCustomEvent("PVREvent", [state, recording]);
this._eventManager.fireEvent(event, this);
}
Modified: oipf/lib/js/impl/VideoBroadcastObject.js
===================================================================
--- oipf/lib/js/impl/VideoBroadcastObject.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/VideoBroadcastObject.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -370,7 +370,7 @@
break;
case this._CONNECTING:
- if (!channelUtils.verifyASuitableTunerAvailable(currentChannel.idType)) {
+ if (!ChannelUtils.verifyASuitableTunerAvailable(currentChannel.idType)) {
this._timeout()
.then(this.changePlayState.bind(this, this._CONNECTING));
} else {
@@ -383,7 +383,7 @@
case this._PRESENTING:
/*if (!verifyASuitableTunerAvailable(currentChannel.idType)) {
- this.timer = oipf.utils.this._timeout()
+ this.timer = OipfUtils.this._timeout()
.then(this.changePlayState.bind(this, this._PRESENTING));
}*/
//Method documentation indicate it don't have effects in this state.
@@ -391,7 +391,7 @@
case this._STOPPED:
//FIX-ME :Make enable video and audio presentation
- if (!channelUtils.verifyASuitableTunerAvailable(currentChannel.idType, this)) {
+ if (!ChannelUtils.verifyASuitableTunerAvailable(currentChannel.idType, this)) {
this._timeout()
.then(this.changePlayState.bind(this, this._STOPPED, 0));
} else {
@@ -421,7 +421,7 @@
changePlayState(state, error) {
console.log("changeState", state);
this.playState = state;
- this._fireEvent(createCustomEvent("PlayStateChange", [this.playState, error]));
+ this._fireEvent(this._eventManager.createCustomEvent("PlayStateChange", [this.playState, error]));
}
noTransientError(channel) {
@@ -442,7 +442,7 @@
if (this.noTransientError(this._CONNECTING) && this.noPermanentError(this._CONNECTING, channel)) {
this.playState = this._CONNECTING;
- this._fireEvent(createCustomEvent("PlayStateChange", [this.playState]));
+ this._fireEvent(this._eventManager.createCustomEvent("PlayStateChange", [this.playState]));
this._timeout()
.then(this.changeStateToPresentingWhenSwitching.bind(this, channel));
}
@@ -453,9 +453,9 @@
if (this.noTransientError(this._PRESENTING)) {
this.setCurrentChannel(channel);
this.playState = this._PRESENTING;
- this._fireEvent(createCustomEvent("PlayStateChange", [this.playState]));
+ this._fireEvent(this._eventManager.createCustomEvent("PlayStateChange", [this.playState]));
this._timeout()
- .then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeSucceeded", [channel])));
+ .then(this._fireEvent.bind(this, this._eventManager.createCustomEvent("ChannelChangeSucceeded", [channel])));
}
}
@@ -556,14 +556,14 @@
if (CHANNEL_CREATION[idType]) { //Verify a channel of this idType (ID_DVB_SI_DIRECT = 13).
- if (channelUtils.isAValidTerrestrialDsd (dsd)) { //Verify the dsd validity.
+ if (ChannelUtils.isAValidTerrestrialDsd (dsd)) { //Verify the dsd validity.
if ((sid >= 1) && (sid <= 65535)) { //Verify the rigth range of service id.
- var newChannel = new Channel(idType, dsd, sid, "localChannel" + createUUID());
+ var newChannel = new Channel(idType, dsd, sid, "localChannel" + OipfUtils.createUUID());
var channelConfig = this._channelService;
- if (channelUtils.getChannelByDsd(channelConfig.channelList, dsd)) {
+ if (ChannelUtils.getChannelByDsd(channelConfig.channelList, dsd)) {
/* Normally channelList is readonly but the method documentation say
* that the channel must be add if it not already present.
@@ -639,7 +639,7 @@
if (idType == 30) {
var equivalentChannel = this._channelService.channelList.getChannelBySourceID(sourceID);
} else if (idType == 40) {
- equivalentChannel = channelUtils.getChannelByIpBroadcastID(ipBroadcastID);
+ equivalentChannel = ChannelUtils.getChannelByIpBroadcastID(ipBroadcastID);
} else {
equivalentChannel = this._channelService.channelList.getChannelByTriplet(onid, tsid, sid);
}
@@ -647,7 +647,7 @@
if (equivalentChannel) {
var newChannel = new Channel(arguments.push(equivalentChannel.name));
} else {
- newChannel = new Channel(arguments.push("localChannel:"+createUUID()));
+ newChannel = new Channel(arguments.push("localChannel:" + OipfUtils.createUUID()));
}
this._channelService.channelList.push(newChannel);
@@ -678,16 +678,16 @@
if (this.playState >= this._UNREALIZED && this.playState <= this._STOPPED && channel) {
- if (channelUtils.verifyASuitableTunerAvailable(channel.idType, this) && channel.idType != 41) {
+ if (ChannelUtils.verifyASuitableTunerAvailable(channel.idType, this) && channel.idType != 41) {
this._timeout()
.then(this.changeStateToConnectingWhenSwitching.bind(this, channel));
} else if (channel.idType == 40 || channel.idType == 41) {
this._timeout()
- .then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeError", [null, 8])));
+ .then(this._fireEvent.bind(this, this._eventManager.createCustomEvent("ChannelChangeError", [null, 8])));
} else {
this._timeout()
- .then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeError", [null, 0])));
+ .then(this._fireEvent.bind(this, this._eventManager.createCustomEvent("ChannelChangeError", [null, 0])));
}
} else {
if (this.playState != this._UNREALIZED) {
@@ -884,7 +884,7 @@
//Verify that the currentChannel exists in the channel list of channel configuration
if (!channelConfig.channelList.getChannel(this.currentChannel.channelId)) {
this._timeout()
- .then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeError", [null, 100])));
+ .then(this._fireEvent.bind(this, this._eventManager.createCustomEvent("ChannelChangeError", [null, 100])));
/*setTimeout(function () {
self.onChannelChangeError && self.onChannelChangeError(null, 100);
} 0);*/
@@ -912,18 +912,18 @@
channelCollection = channelConfig.currentFavouriteLists;
}
- var channelToChange = channelUtils.findChannel(channelCollection, this.currentChannel, step);
+ var channelToChange = ChannelUtils.findChannel(channelCollection, this.currentChannel, step);
- if (channelUtils.verifyASuitableTunerAvailable(channelToChange.idType, this)) {
+ if (ChannelUtils.verifyASuitableTunerAvailable(channelToChange.idType, this)) {
this._timeout()
.then(this.changeStateToConnectingWhenSwitching.bind(this, channelToChange));
} else if (channelToChange.idType == 40 || channelToChange.idType == 41) {
this._timeout()
- .then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeError", [null, 8])));
+ .then(this._fireEvent.bind(this, this._eventManager.createCustomEvent("ChannelChangeError", [null, 8])));
} else {
this._timeout()
- .then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeError", [null, 0])));
+ .then(this._fireEvent.bind(this, this._eventManager.createCustomEvent("ChannelChangeError", [null, 0])));
}
}
@@ -931,7 +931,7 @@
} else {
//When the OITF does not maintain channel list or favourite list by itself
this._timeout()
- .then(this._fireEvent.bind(this, createCustomEvent("ChannelChangeError", [null, 10])));
+ .then(this._fireEvent.bind(this, this._eventManager.createCustomEvent("ChannelChangeError", [null, 10])));
}
}
Modified: oipf/lib/js/impl/model/Application.js
===================================================================
--- oipf/lib/js/impl/model/Application.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/Application.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -194,7 +194,7 @@
}
_fireEvent(eventName) {
- var event = createCustomEvent(eventName, null);
+ var event = this._eventManager.createCustomEvent(eventName, null);
this._eventManager.fireEvent(event, this);
}
}
Modified: oipf/lib/js/impl/model/Channel.js
===================================================================
--- oipf/lib/js/impl/model/Channel.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/Channel.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -131,7 +131,7 @@
6: "_createChannelIPTV"
};
- (arguments.length !== 6) && this._setCcid(createUUID());
+ (arguments.length !== 6) && this._setCcid(OipfUtils.createUUID());
this[dispatcher[arguments.length]].apply(this, arguments);
}
@@ -173,7 +173,7 @@
}
_createChannelFromConf(channelConf) {
- oipf.utils.initProperties.call(this, channelConf);
+ OipfUtils.initProperties.call(this, channelConf);
}
}
Modified: oipf/lib/js/impl/model/Configuration.js
===================================================================
--- oipf/lib/js/impl/model/Configuration.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/Configuration.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -123,7 +123,7 @@
*/
this.preferredTimeShiftMode = null;
- oipf.utils.initProperties.call(this, defaultProperties);
+ OipfUtils.initProperties.call(this, defaultProperties);
this._keys = {};
}
Modified: oipf/lib/js/impl/model/LNBInfo.js
===================================================================
--- oipf/lib/js/impl/model/LNBInfo.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/LNBInfo.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -89,7 +89,7 @@
*/
this.orbitalPosition = null;
- oipf.utils.initProperties.call(this, defaultProperties);
+ OipfUtils.initProperties.call(this, defaultProperties);
}
}
Modified: oipf/lib/js/impl/model/LocalSystem.js
===================================================================
--- oipf/lib/js/impl/model/LocalSystem.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/LocalSystem.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -381,7 +381,7 @@
this._timerManager = new TimerManager();
this._timeout = this._timerManager.createTimer;
this._defaultProperties = defaultProperties;
- oipf.utils.initProperties.call(this, defaultProperties.localSystem);
+ OipfUtils.initProperties.call(this, defaultProperties.localSystem);
this.systemReady = true;
}
@@ -549,7 +549,7 @@
this.powerState = type;
this._timeout()
.then(this._fireEvent.bind(
- this, createCustomEvent("PowerStateChange", [this.powerState])));
+ this, this._eventManager.createCustomEvent("PowerStateChange", [this.powerState])));
return true;
}
Modified: oipf/lib/js/impl/model/ModelFactory.js
===================================================================
--- oipf/lib/js/impl/model/ModelFactory.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/ModelFactory.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -28,7 +28,7 @@
getAProgrammeFromXmlTvData() {
console.log("Method createXmlTvData");
- var randomIndex = oipf.utils.getRandomNumberBetweenMinMax(0,
+ var randomIndex = OipfUtils.getRandomNumberBetweenMinMax(0,
this.xmlTvData.programmes.length);
if (this.xmlTvData && this.xmlTvData.programmes[randomIndex]) {
Modified: oipf/lib/js/impl/model/Programme.js
===================================================================
--- oipf/lib/js/impl/model/Programme.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/Programme.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -326,7 +326,7 @@
*/
this.recording = null;
- oipf.utils.initProperties.call(this, initObject);
+ OipfUtils.initProperties.call(this, initObject);
}
/*
Modified: oipf/lib/js/impl/model/Recording.js
===================================================================
--- oipf/lib/js/impl/model/Recording.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/Recording.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -54,9 +54,9 @@
this.isManual = true;
associatedScheduledRecording &&
- oipf.utils.initProperties.call(this, associatedScheduledRecording);
+ OipfUtils.initProperties.call(this, associatedScheduledRecording);
- this.id = createUUID();
+ this.id = OipfUtils.createUUID();
}
_setRecordingStartTime(recordingStartTime) {
Modified: oipf/lib/js/impl/model/ScheduledRecording.js
===================================================================
--- oipf/lib/js/impl/model/ScheduledRecording.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/ScheduledRecording.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -234,7 +234,7 @@
this.customMetadata = null;
this.state = this.RECORDING_SCHEDULED;
- this.scheduleID = createUUID();
+ this.scheduleID = OipfUtils.createUUID();
if (parameters.length == 1) {
this._initFromProgramme.apply(this, parameters);
} else {
Modified: oipf/lib/js/impl/model/SearchResults.js
===================================================================
--- oipf/lib/js/impl/model/SearchResults.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/SearchResults.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -193,7 +193,7 @@
var next = true;
if (constraints.length > 0 &&
- oipf.utils.isPresent(constraints, programme.channel.name)) {
+ OipfUtils.isPresent(constraints, programme.channel.name)) {
this._cachedResults.push(programme);
next = false;
@@ -217,7 +217,7 @@
var programme = programmes[i];
if (constraints.length > 0 &&
- oipf.utils.isPresent(constraints, programme.channel.name) &&
+ OipfUtils.isPresent(constraints, programme.channel.name) &&
programme.duration) {
var stopTime = programme.startTime +
@@ -255,20 +255,20 @@
if (query._and.length > 0 && query._or.length > 0) {
- return (oipf.utils[methodName].call(null, programme[field], value) && this._evaluateQueryLoop(query._and, programme))
- || (oipf.utils[methodName].call(null, programme[field], value)
+ return (OipfUtils[methodName].call(null, programme[field], value) && this._evaluateQueryLoop(query._and, programme))
+ || (OipfUtils[methodName].call(null, programme[field], value)
|| this._evaluateQueryLoop(query._and, programme));
} else if (query._and.length > 0 && query._or.length === 0) {
- return (oipf.utils[methodName].call(null, programme[field], value) && this._evaluateQueryLoop(query._and, programme));
+ return (OipfUtils[methodName].call(null, programme[field], value) && this._evaluateQueryLoop(query._and, programme));
} else if (query._or.length > 0 && query._and.length === 0) {
- return (oipf.utils[methodName].call(null, programme[field], value) && this._evaluateQueryLoop(query._or, programme));
+ return (OipfUtils[methodName].call(null, programme[field], value) && this._evaluateQueryLoop(query._or, programme));
} else if (query._and.length === 0 && query._or.length === 0) {
- return (oipf.utils[methodName].call(null, programme[field], value));
+ return (OipfUtils[methodName].call(null, programme[field], value));
}
}
Modified: oipf/lib/js/impl/model/SignalInfo.js
===================================================================
--- oipf/lib/js/impl/model/SignalInfo.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/SignalInfo.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -8,7 +8,7 @@
class SignalInfo {
constructor(defaultProperties) {
- oipf.utils.initProperties.call(this, defaultProperties);
+ OipfUtils.initProperties.call(this, defaultProperties);
/*
* Description:
Modified: oipf/lib/js/impl/model/Tuner.js
===================================================================
--- oipf/lib/js/impl/model/Tuner.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/impl/model/Tuner.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -14,7 +14,7 @@
class Tuner {
constructor(name, idTypes, defaultProperties) {
- oipf.utils.initProperties.call(this, defaultProperties);
+ OipfUtils.initProperties.call(this, defaultProperties);
/*
* Description: A unique identifier of the tuner.
Modified: oipf/lib/js/utils/ChannelUtils.js
===================================================================
--- oipf/lib/js/utils/ChannelUtils.js 2015-06-10 08:54:02 UTC (rev 1682)
+++ oipf/lib/js/utils/ChannelUtils.js 2015-06-10 09:04:42 UTC (rev 1683)
@@ -1,103 +1,106 @@
-var channelUtils = {};
+class ChannelUtils {
-channelUtils.findChannel = function(channelCollection, channel, step) {
- for (var i = 0, l = channelCollection.length; i < l; i++ ) {
-
- if (channelCollection[i] == channel) {
-
- if ((i == 0) && (step == -1)) {
- var index = channelCollection.length + step;
-
- } else {
-
- if((i == (channelCollection.length-1)) && (step == 1)) {
- index = 0;
-
+ static findChannel(channelCollection, channel, step) {
+ for (var i = 0, l = channelCollection.length; i < l; i++) {
+
+ if (channelCollection[i] == channel) {
+
+ if ((i == 0) && (step == -1)) {
+ var index = channelCollection.length + step;
+
} else {
- index = i + step;
-
+
+ if ((i == (channelCollection.length-1)) && (step == 1)) {
+ index = 0;
+
+ } else {
+ index = i + step;
+
+ }
}
+ return channelCollection[index];
}
- return channelCollection[index];
}
- }
- return null;
-};
-
-channelUtils.isAValidDVBTChannel = function (channel) {
- return (channel.onid) && (channel.tsid) && (channel.sid);
-};
-
-/*
- * Description:
- * This method verify that a tuner is available to receive a channel with this "idType".
- * And return the first tuner found which match the "idType".
- * Actually all video broadcast will use the same tuner because there is only one and
- * this choice would be directed by parameter.
- *
- * ToDo :Normally the method should check if the tuner don't locked by another object but
- * no way to do that in the norm.
- *
- * Argument:
- * - idType : the type of tuner researched.
- *
- * Return: Tuner
- */
-channelUtils.verifyASuitableTunerAvailable = function(idType, object) {
- var config = oipfObjectFactory.createConfigurationObject();
- var availableTuners = config.localSystem.tuners;
-
- for (var i = 0; i < availableTuners.length; i++) {
- var tunerIdTypes = availableTuners[i].idTypes;
- for (var j = 0; j < tunerIdTypes.length; j++) {
- var tuner = availableTuners[i];
- if (tunerIdTypes[j] == idType) {
- return tuner;
+ return null;
+ };
+
+ static isAValidDVBTChannel(channel) {
+ return (channel.onid) && (channel.tsid) && (channel.sid);
+ };
+
+ /*
+ * Description:
+ * This method verify that a tuner is available to receive a channel with this "idType".
+ * And return the first tuner found which match the "idType".
+ * Actually all video broadcast will use the same tuner because there is only one and
+ * this choice would be directed by parameter.
+ *
+ * ToDo :Normally the method should check if the tuner don't locked by another object but
+ * no way to do that in the norm.
+ *
+ * Argument:
+ * - idType : the type of tuner researched.
+ *
+ * Return: Tuner
+ */
+ static verifyASuitableTunerAvailable(idType, object) {
+ var config = oipfObjectFactory.createConfigurationObject();
+ var availableTuners = config.localSystem.tuners;
+
+ for (var i = 0; i < availableTuners.length; i++) {
+ var tunerIdTypes = availableTuners[i].idTypes;
+ for (var j = 0; j < tunerIdTypes.length; j++) {
+ var tuner = availableTuners[i];
+ if (tunerIdTypes[j] == idType) {
+ return tuner;
+ }
}
}
- }
-
- return null;
-};
-
-channelUtils.getChannelByDsd = function(channelCollection, dsd) {
- for (var i = 0, l = channelCollection.length; i < l; i++) {
- if (channelCollection[i].dsd == dsd) {
- return channelCollection[i];
+
+ return null;
+ };
+
+ static getChannelByDsd(channelCollection, dsd) {
+ for (var i = 0, l = channelCollection.length; i < l; i++) {
+ if (channelCollection[i].dsd == dsd) {
+ return channelCollection[i];
+ }
}
- }
-};
-
-/*
- * Description:
- * This method verify the validity of the terrestrial delivery system descriptor.
- * The argument will be compare to the dsd array byte defined either in
- * the transport stream or directly in the terminal.
- *
- * Arguments
- * - dsd: the delivery system descriptor string necessary to create a channel by intermediate of method
- * createChannelObject.
- */
-channelUtils.isAValidTerrestrialDsd = function(dsd) {
- var dsdAttributes = dsd.split(",");
-
- if (TERRESTIAL_DELIVERY_SYSTEM_DESCRIPTOR.length == dsdAttributes.length) {
-
- for (var i = 0, l = TERRESTIAL_DELIVERY_SYSTEM_DESCRIPTOR.length; i < l; i++) {
-
- if (!(TERRESTIAL_DELIVERY_SYSTEM_DESCRIPTOR[i] == dsdAttributes[i])) {
- return false;
+ };
+
+ /*
+ * Description:
+ * This method verify the validity of the terrestrial delivery system descriptor.
+ * The argument will be compare to the dsd array byte defined either in
+ * the transport stream or directly in the terminal.
+ *
+ * Arguments
+ * - dsd: the delivery system descriptor string necessary to create a channel by intermediate of method
+ * createChannelObject.
+ */
+ static isAValidTerrestrialDsd(dsd) {
+ var dsdAttributes = dsd.split(",");
+
+ if (TERRESTIAL_DELIVERY_SYSTEM_DESCRIPTOR.length == dsdAttributes.length) {
+
+ for (var i = 0, l = TERRESTIAL_DELIVERY_SYSTEM_DESCRIPTOR.length; i < l; i++) {
+
+ if (!(TERRESTIAL_DELIVERY_SYSTEM_DESCRIPTOR[i] == dsdAttributes[i])) {
+ return false;
+ }
}
+
+ return true;
}
-
- return true;
- }
-};
-
-channelUtils.getChannelByIpBroadcastID = function(channelCollection, ipBroadcastID) {
- for (var i = 0, l = channelCollection.length; i < l; i++) {
- if (channelCollection[i].ipBroadcastID == ipBroadcastID) {
- return channelCollection[i];
+ };
+
+ static getChannelByIpBroadcastID(channelCollection, ipBroadcastID) {
+ for (var i = 0, l = channelCollection.length; i < l; i++) {
+ if (channelCollection[i].ipBroadcastID == ipBroadcastID) {
+ return channelCollection[i];
+ }
}
- }
-};
+ };
+
+}
+
1
0
Author: ygrego
Date: 2015-06-10 08:54:02 +0000 (Wed, 10 Jun 2015)
New Revision: 1682
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1682
Log:
Now Test.js must use the static method 'OipfUtils.timeout'.
Modified:
oipf/test/js/Test.js
Modified: oipf/test/js/Test.js
===================================================================
--- oipf/test/js/Test.js 2015-06-10 08:50:42 UTC (rev 1681)
+++ oipf/test/js/Test.js 2015-06-10 08:54:02 UTC (rev 1682)
@@ -1047,7 +1047,7 @@
var result = false;
var promiseTest = new Promise(function(resolve, reject) {
try {
- timeout(object.timer || 5000)
+ OipfUtils.timeout(object.timer || 5000)
.then(reject.bind(null, "No result returned."))
.then(function() {
!result
1
0
Author: ygrego
Date: 2015-06-10 08:50:42 +0000 (Wed, 10 Jun 2015)
New Revision: 1681
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1681
Log:
Utils.js has been deleted and its content has been moved to class OipfUtils.js
Added:
oipf/lib/js/utils/OipfUtils.js
Removed:
oipf/lib/js/utils/Utils.js
Copied: oipf/lib/js/utils/OipfUtils.js (from rev 1680, oipf/lib/js/utils/Utils.js)
===================================================================
--- oipf/lib/js/utils/OipfUtils.js (rev 0)
+++ oipf/lib/js/utils/OipfUtils.js 2015-06-10 08:50:42 UTC (rev 1681)
@@ -0,0 +1,95 @@
+class OipfUtils {
+
+ static initProperties(defaultProperties) {
+ var keys = Object.keys(defaultProperties);
+ for (var i = 0, l = keys.length; i < l; i++) {
+ this[keys[i]] = defaultProperties[keys[i]];
+ }
+ }
+
+ static timeout(time) {
+ return new Timeout(time);
+ }
+
+ static equals(field1, field2) {
+ return field1 == field2;
+ }
+
+ static notEquals(field1, field2) {
+ return field1 != field2;
+ }
+
+ static superior(field1, field2) {
+ return field1 > field2;
+ }
+
+ static superiorOrEquals(field1, field2) {
+ return field1 >= field2;
+ }
+
+ static inferior(field1, field2) {
+ return field1 < field2;
+ }
+
+ static inferiorOrEquals(field1, field2) {
+ return field1 <= field2;
+ }
+
+ static contains(field1, field2) {
+ return field1 == field2;
+ }
+
+ static generateFourDigit() {
+
+ return Math.floor(Math.random() * 9000) + 1000;
+ }
+
+ static getRandomNumberBetweenMinMax(min, max) {
+ return Math.floor(Math.random() * (max - min)) + min;
+ }
+
+ static isPresent(list, element) {
+
+ for (var i = 0, l = list.length; i < l; i++) {
+ if (OipfUtils.equals(list[i].name, element)) {
+ return true;
+ }
+ }
+ }
+
+ /*
+ * Some code based on RFC 4122, section 4.4
+ * (Algorithms for Creating a UUID from Truly Random or Pseudo-Random Number).
+ */
+ static createUUID() {
+ // http://www.ietf.org/rfc/rfc4122.txt
+ var s = [];
+ var hexDigits = "0123456789abcdef";
+ for (var i = 0; i < 36; i++) {
+ s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
+ }
+ s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
+ s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
+ s[8] = s[13] = s[18] = s[23] = "-";
+
+ var uuid = s.join("");
+ return uuid;
+ }
+
+ /*
+ * Description:
+ * Should be use in each test method in anticipation of tests executed on a tv platform.
+ */
+ static isMethodImplemented(object, methodName) {
+ return object[methodName];
+ }
+
+ static upperCaseFirstChar(string) {
+ return string.charAt(0).toUpperCase() + string.slice(1);
+ }
+
+ static logTest() {
+ console.log.apply(console, arguments);
+ }
+
+}
Deleted: oipf/lib/js/utils/Utils.js
===================================================================
--- oipf/lib/js/utils/Utils.js 2015-06-10 08:13:47 UTC (rev 1680)
+++ oipf/lib/js/utils/Utils.js 2015-06-10 08:50:42 UTC (rev 1681)
@@ -1,121 +0,0 @@
-/*
- * Some code based on RFC 4122, section 4.4
- * (Algorithms for Creating a UUID from Truly Random or Pseudo-Random Number).
- */
-var oipf = {
- utils: {}
-};
-
-
-oipf.utils.initProperties = function(defaultProperties) {
- var keys = Object.keys(defaultProperties);
- for (var i = 0, l = keys.length; i < l; i++) {
- this[keys[i]] = defaultProperties[keys[i]];
- }
-};
-
-oipf.utils.timeout = function(time) {
- return new Timeout(time);
-};
-
-oipf.utils.equals = function(field1, field2) {
- return field1 == field2;
-};
-
-oipf.utils.notEquals = function(field1, field2) {
- return field1 != field2;
-};
-
-oipf.utils.superior = function(field1, field2) {
- return field1 > field2;
-};
-
-oipf.utils.superiorOrEquals = function(field1, field2) {
- return field1 >= field2;
-};
-
-oipf.utils.inferior = function(field1, field2) {
- return field1 < field2;
-};
-
-oipf.utils.inferiorOrEquals = function(field1, field2) {
- return field1 <= field2;
-};
-
-oipf.utils.contains = function(field1, field2) {
- return field1 == field2;
-};
-
-oipf.utils.generateFourDigit = function() {
-
- return Math.floor(Math.random() * 9000) + 1000;
-};
-
-oipf.utils.getRandomNumberBetweenMinMax = function(min, max) {
- return Math.floor(Math.random() * (max - min)) + min;
-};
-
-oipf.utils.isPresent = function(list, element) {
-
- for (var i = 0, l = list.length; i < l; i++) {
- if (oipf.utils.equals(list[i].name, element)) {
- return true;
- }
- }
-};
-
-function createUUID() {
- // http://www.ietf.org/rfc/rfc4122.txt
- var s = [];
- var hexDigits = "0123456789abcdef";
- for (var i = 0; i < 36; i++) {
- s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
- }
- s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
- s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
- s[8] = s[13] = s[18] = s[23] = "-";
-
- var uuid = s.join("");
- return uuid;
-}
-
-/*
- * Description:
- * Should be use in each test method in anticipation of tests executed on a tv platform.
- */
-function isMethodImplemented(object, methodName) {
- return object[methodName];
-}
-
-/*
- * Description:
- * Encapsulation of function "setTimeout" in order to it be accessible for all object and also reusable.
- */
-function timeout(time) {
- return new Promise(function(resolve, reject) {
- setTimeout(resolve, time);
- });
-}
-
-function upperCaseFirstChar(string) {
- return string.charAt(0).toUpperCase() + string.slice(1);
-}
-
-function logTest() {
- console.log.apply(console, arguments);
-}
-
-function createCustomEvent(type, param) {
- return new CustomEvent(type, {detail :param});
-}
-
-function updateProperty(id, property, value){
- var getElById = document.getElementById.bind(document);
-
- if (property == "backgroundColor") {
- getElById(id)["style"][property] = value;
- } else {
- getElById(id)[property] = value;
- }
-
-}
1
0
Author: smaisonneuve
Date: 2015-06-10 08:13:47 +0000 (Wed, 10 Jun 2015)
New Revision: 1680
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1680
Log:
[Doc] - Adding readme in each project
Added:
oipf/emulator/readme.txt
oipf/lib/readme.txt
oipf/test/readme.txt
Added: oipf/emulator/readme.txt
===================================================================
--- oipf/emulator/readme.txt (rev 0)
+++ oipf/emulator/readme.txt 2015-06-10 08:13:47 UTC (rev 1680)
@@ -0,0 +1,3 @@
+This project is a web project built on top of oipf implementation. It gives you the ability to use the oipf implementation directly on your local machine.
+
+To launch the project, run node server.js and browse http://<ip address of your machine>:4000
Added: oipf/lib/readme.txt
===================================================================
--- oipf/lib/readme.txt (rev 0)
+++ oipf/lib/readme.txt 2015-06-10 08:13:47 UTC (rev 1680)
@@ -0,0 +1,13 @@
+This project is an implementation of oipf standard. You compile it and use it as a library.
+
+To build the project, you need to install the require dependencies :
+> npm install
+
+then install Gulp :
+> npm install gulp -g
+
+and finally, run gulp :
+> gulp
+
+The gulp task is watching for change within the oipf project files. If you make a change, the project will be automatically rebuilt.
+The building process produce a js bundle under build/ directory. It also copy the static files that the library need to work. If you want to use this library in another project, you need to point to that directory or embed the files within the build dir.
Added: oipf/test/readme.txt
===================================================================
--- oipf/test/readme.txt (rev 0)
+++ oipf/test/readme.txt 2015-06-10 08:13:47 UTC (rev 1680)
@@ -0,0 +1,6 @@
+This is project contains unit test for oipf implementation. You can run it on a machine to determine how well it handle oipf : it will gives you a feedback on what part of the spec is supported or not.
+
+To run the project, run :
+> node server.js
+
+Then browse http://<ip address of your machine>:3000
1
0
Author: jruchaud
Date: 2015-06-10 07:56:34 +0000 (Wed, 10 Jun 2015)
New Revision: 1679
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1679
Log:
Fix collection
Modified:
oipf/lib/js/impl/model/Collection.js
Modified: oipf/lib/js/impl/model/Collection.js
===================================================================
--- oipf/lib/js/impl/model/Collection.js 2015-06-09 21:38:59 UTC (rev 1678)
+++ oipf/lib/js/impl/model/Collection.js 2015-06-10 07:56:34 UTC (rev 1679)
@@ -1,7 +1,8 @@
-class Collection extends Array{
+class Collection extends Array {
constructor(...args) {
- super(...args);
+ super();
+ this.push(...args);
}
item(index) {
1
0