aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authort-adamre <t-adamre@T-ADAMRE.redmond.corp.microsoft.com>2012-06-12 14:54:30 -0700
committert-adamre <t-adamre@T-ADAMRE.redmond.corp.microsoft.com>2012-06-12 14:54:30 -0700
commit385b4f716367daeff9b78b400df86e896ad2bee7 (patch)
tree4bcfaf77d76ce72ae2f1d18d633bf06d154de028
parent9c4881627732856622d8dc2ca6bc7ed950ff5e60 (diff)
Add capability to run chapters individually from the website
-rw-r--r--test/harness/helper.js111
-rw-r--r--test/harness/sth.js372
-rw-r--r--tools/packaging/templates/runner.test262.html34
-rw-r--r--website/default.html34
-rw-r--r--website/harness/helper.js111
-rw-r--r--website/harness/sth.js372
-rw-r--r--website/images/run.pngbin0 -> 2016 bytes
-rw-r--r--website/images/runall.pngbin0 -> 2657 bytes
-rw-r--r--website/images/runselected.pngbin0 -> 3072 bytes
-rw-r--r--website/images/select.pngbin0 -> 2370 bytes
-rw-r--r--website/images/selected.pngbin0 -> 1313 bytes
-rw-r--r--website/styles/style.css68
-rw-r--r--website/testcases_ch07.html34
-rw-r--r--website/testcases_ch08.html34
-rw-r--r--website/testcases_ch09.html34
-rw-r--r--website/testcases_ch10.html34
-rw-r--r--website/testcases_ch11.html34
-rw-r--r--website/testcases_ch12.html34
-rw-r--r--website/testcases_ch13.html34
-rw-r--r--website/testcases_ch14.html34
-rw-r--r--website/testcases_ch15.html34
21 files changed, 1060 insertions, 348 deletions
diff --git a/test/harness/helper.js b/test/harness/helper.js
index d44f3c329..1e97d4a90 100644
--- a/test/harness/helper.js
+++ b/test/harness/helper.js
@@ -34,30 +34,77 @@ function Presenter() {
}
}
+ /* Updates the displayed version. */
this.setVersion = function(v) {
version = v;
$(".targetTestSuiteVersion").text(v);
}
-
- this.setDate = function(d) {
+
+ /* Updates the displayed date. */
+ this.setDate = function(d) {
date = d;
$(".targetTestSuiteDate").text(d);
}
-
+
+ /* Updates the displayed number of tests to run. */
this.setTotalTests = function(tests) {
totalTests = tests;
$('#testsToRun').text(tests);
}
- /* Write status to the activity bar. */
+ /* Write status to the activity bar. */
this.updateStatus = function (str) {
this.activityBar.text(str);
}
-
- this.finished = function(elapsed) {
- $('.button-start').attr('src', 'images/start.png');
- $('.button-start').fadeOut('fast');
+
+ /* When starting to load a test, create a table row entry and buttons. Display file path. */
+ this.setTestWaiting = function(index, path) {
+ var appendMsg = '<tr class="waiting"><td height="29" class="chapterName">Waiting to load test file: ' + path + '</td>';
+ appendMsg += '<td width="83"><img src="images/select.png" alt="Select" title="Toggle the selection of this chapter." /></td>';
+ appendMsg += '<td width="83"><img src="images/run.png" alt="Run" title="Run this chapter individually." /></td></tr>';
+
+ $('#chapterSelector table').append(appendMsg);
+ // Find the table row
+ var tr = $('#chapterSelector table tr').filter(":last-child");
+ // Attach click listeners to the buttons
+ tr.find("img").filter('[alt="Select"]').bind("click", {tr: tr, index: index}, function(event) {
+ controller.toggleSelection(event.data.index);
+ // Deselect row
+ if(event.data.tr.hasClass("selectedChapter")) {
+ event.data.tr.removeClass("selectedChapter");
+ event.data.tr.find('img').filter('[alt="Selected"]').attr({
+ src: 'images/select.png',
+ alt: 'Select'
+ });
+ }
+ // Select row
+ else {
+ event.data.tr.addClass("selectedChapter");
+ event.data.tr.find('img').filter('[alt="Select"]').attr({
+ src: 'images/selected.png',
+ alt: 'Selected'
+ });
+ }
+ });
+ }
+
+ this.setTestLoading = function(index, path) {
+ var tr = $('#chapterSelector table tr').filter(":nth-child(" + (index+1) + ")");
+ tr.removeClass("waiting");
+ tr.addClass("loading");
+ tr.find(":first-child").html("Loading test file: " + path);
+ };
+
+ /* On test loaded, display the chapter name and the number of tests */
+ this.setTestLoaded = function(index, name, numTests) {
+ var tr = $('#chapterSelector table tr').filter(":nth-child(" + (index+1) + ")");
+ tr.removeClass("loading");
+ tr.find("td").filter(":first-child").html(name + " (" + numTests + " tests)");
+ }
+
+ /* Called when the tests finish executing. */
+ this.finished = function(elapsed) {
progressBar.find(".text").html("Testing complete!");
if (isSiteDebugMode()) {
this.activityBar.text('Overall Execution Time: ' + elapsed + ' minutes');
@@ -65,27 +112,19 @@ function Presenter() {
this.activityBar.text('');
}
}
-
- this.started = function () {
- $('.button-start').attr('src', 'images/pause.png');
- }
-
- this.paused = function () {
- $('.button-start').attr('src', 'images/resume.png');
- }
- this.reset = function() {
+ this.reset = function () {
globalSection.reset();
updateCounts();
+ this.activityBar.text('');
logger.empty();
currentSection = globalSection;
renderCurrentSection();
- $('.button-start').show();
}
- /* Do some setup tasks. */
+ /* Do some setup tasks. */
this.setup = function() {
backLink = $('#backlinkDiv');
backLink.click(goBack);
@@ -105,7 +144,29 @@ function Presenter() {
renderCurrentSection();
}
- //**IMPLEMENTATION DETAILS***************************************************
+ /* The state machine for the button display. */
+ this.setState = function(state) {
+ // Hide all the buttons
+ $('.progressBarButtons img').addClass("hide");
+ // Only show what is needed.
+ if(state == 'loading') {
+ $('#btnRunAll').removeClass('hide');
+ $('#btnRunSelected').removeClass('hide');
+ }
+ else if(state == 'paused') {
+ $('#btnResume').removeClass('hide');
+ $('#btnReset').removeClass('hide');
+ }
+ else if(state == 'running') {
+ $('#btnPause').removeClass('hide');
+ }
+ else if(state == 'loaded') {
+ $('#btnRunAll').removeClass('hide');
+ $('#btnRunSelected').removeClass('hide');
+ }
+ };
+
+ //**IMPLEMENTATION DETAILS***************************************************
/* Renders the current section into the report window. */
function renderCurrentSection() {
@@ -352,11 +413,11 @@ function Presenter() {
xml = '<testRun>\r\n' +
'<userAgent>' + window.navigator.userAgent + '</userAgent>\r\n' +
- '<Date>' + dateNow.toDateString() + '</Date>\r\n' +
- '<targetTestSuiteName>ECMAScript Test262 Site</targetTestSuiteName>\r\n' +
- '<targetTestSuiteVersion>' + version + '</targetTestSuiteVersion>\r\n' +
- '<targetTestSuiteDate>' + date + '</targetTestSuiteDate>\r\n' +
- ' <Tests>\r\n\r\n';
+ '<Date>' + dateNow.toDateString() + '</Date>\r\n' +
+ '<targetTestSuiteName>ECMAScript Test262 Site</targetTestSuiteName>\r\n' +
+ '<targetTestSuiteVersion>' + version + '</targetTestSuiteVersion>\r\n' +
+ '<targetTestSuiteDate>' + date + '</targetTestSuiteDate>\r\n' +
+ ' <Tests>\r\n\r\n';
reportWindow = window.open();
reportWindow.document.writeln("<title>ECMAScript Test262 XML</title>");
diff --git a/test/harness/sth.js b/test/harness/sth.js
index 91656937c..c2ce49371 100644
--- a/test/harness/sth.js
+++ b/test/harness/sth.js
@@ -85,6 +85,7 @@ function BrowserRunner() {
/* Run the test. */
this.run = function (test, code) {
+ var start = new Date();
//--Detect proper window.onerror support
if (instance.supportsWindowOnerror===undefined) {
@@ -121,7 +122,7 @@ function BrowserRunner() {
document.body.removeChild(iframePrereqs);
instance.run(test, code);
}, 500);
- return;
+ return 0; // initial config, ignore this timing.
}
currentTest = {};
@@ -207,6 +208,10 @@ function BrowserRunner() {
idoc.writeln(globalScopeContents);
idoc.writeln("</script>");
idoc.close();
+
+ var elapsed = new Date() - start;
+
+ return elapsed;
};
//--Helper functions-------------------------------------------------------
@@ -227,7 +232,7 @@ function BrowserRunner() {
*
* Callbacks:
* * onLoadingNextSection(path): Called after a request is sent for the next section json, with the path to that json.
- * * onInitialized(totalTests, version, date): Called after the testcases.json is loaded and parsed.
+ * * onInitialized(totalTests): Called after the testcases.json is loaded and parsed.
* * onTestReady(id, code): Called when a test is ready with the
* test's id and code.
* * onTestsExhausted(): Called when there are no more tests to run.
@@ -236,35 +241,33 @@ function TestLoader() {
var testGroups = [],
testGroupIndex = 0,
currentTestIndex = 0,
- loader = this;
+ loader = this,
+ mode = "all";
- this.version = undefined;
- this.date = undefined;
- this.totalTests = 0;
+ this.loadedFiles = 0;
+ this.version = undefined;
+ this.date = undefined;
+ this.totalTests = 0;
+ this.runningTests = 0;
/* Get the XML for the next section */
function getNextXML() {
- var group = testGroups[testGroupIndex];
currentTestIndex = 0;
- if(group.tests.length > 0) {
- // already loaded this section.
+ // already loaded this section.
+ if(testGroups[testGroupIndex].status == 'loaded') {
+ testGroups[testGroupIndex].onLoaded = function(){};
loader.getNextTest();
return;
}
- $.ajax({url: group.path, dataType: 'json', success: function(data) {
- group.tests = data.testsCollection.tests;
- loader.getNextTest();
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- //alert(XMLHttpRequest);
- }
-
- });
-
- loader.onLoadingNextSection(group.path);
+ // not loaded, so we attach a callback to come back here when the file loads.
+ else {
+ presenter.updateStatus("Loading file: " + testGroups[testGroupIndex].path);
+ testGroups[testGroupIndex].onLoaded = getNextXML;
+
+ }
}
-
+
/* Get the test list xml */
function loadTestXML() {
var testsListLoader = new XMLHttpRequest();
@@ -279,14 +282,99 @@ function TestLoader() {
for (var i = 0; i < testSuite.length; i++) {
testGroups[i] = {
path: testSuite[i],
- tests: []
+ tests: [],
+ selected: false,
+ status: 'waiting',
+ onLoaded: function(){}
};
+ presenter.setTestWaiting(i, testSuite[i]);
+
+ var tr = $('#chapterSelector table tr').filter(':nth-child(' + (i+1) + ')');
+ tr.find('img').filter('[alt="Run"]').bind('click', {index:i}, function(event){
+ controller.runIndividualTest(event.data.index);
+ });
}
loader.onInitialized(loader.totalTests);
- getNextXML();
+ getFile();
}});
}
+
+ /* Get the test file. Handles all the logic of figuring out the next file to load. */
+ function getFile(index) {
+ index = (arguments.length == 0) ? -1 : index;
+
+ // Look for selected waiting chapters (priority because you'll probably want to run them soon)
+ for(var i = 0; index == -1 && i < testGroups.length; i++) {
+ if(testGroups[i].status == 'waiting' && testGroups[i].selected) {
+ index = i;
+ }
+ }
+
+ // Look for just chapters waiting to be loaded.
+ for(var i = 0; index == -1 && i < testGroups.length; i++) {
+ if(testGroups[i].status == 'waiting') {
+ index = i;
+ }
+ }
+
+ if(index == -1) {
+ // Still -1? No more tests are waiting to be loaded then.
+ if(controller.state == 'loading') {
+ presenter.setState('loaded');
+ }
+ return;
+ }
+
+ presenter.setTestLoading(index, testGroups[index].path);
+ // the only other status that should be set when we get here is 'priorityloading'
+ if(testGroups[index].status == 'waiting') {
+ testGroups[index].status = 'loading';
+ }
+
+ loader.onTestStartLoading(index, testGroups[index].path);
+ // Create the AJAX call to grab the file.
+ $.ajax({
+ url: testGroups[index].path,
+ dataType: 'json',
+ // Callback with the chapter name and number of tests.
+ success: function(data, status, xhr) {
+ // Save the data for later usage
+ testGroups[index].tests = data.testsCollection.tests;
+ onTestLoaded(index, data.testsCollection.name, data.testsCollection.tests.length);
+ },
+ error: function(xhr, textStatus, errorThrown) {
+ // TODO: Catch this error and update UI accordingly. Unlikely to happen, but errors would be 404 or 5-- errors.
+
+ }
+ });
+ }
+
+ /* Executes when a test file finishes loading. */
+ function onTestLoaded(index, name, numTests) {
+ presenter.setTestLoaded(index, name, numTests);
+ if(testGroups[index].selected && mode == "multiple") {
+ loader.runningTests += numTests;
+ loader.onInitialized( loader.runningTests );
+ }
+
+ // The loading status is only assigned when downloading files in sequence, otherwise it
+ // gets the status of priorityloading. When loading out of order, we only want to download
+ // the single file, so we'll only tell it to get the next file when we see a status of
+ // loading.
+ if(testGroups[index].status == 'loading') {
+ getFile(); // triggers downloading the next file
+ testGroups[index].status = 'loaded';
+ }
+ else if(testGroups[index].status == 'priorityloading') {
+ // Run the test
+ testGroups[index].status = 'loaded';
+ loader.setChapter(index);
+ }
+
+ testGroups[index].onLoaded();
+ };
+
function getIdFromPath (path) {
//path is of the form "a/b/c.js"
@@ -304,42 +392,128 @@ function TestLoader() {
/* Move on to the next test */
this.getNextTest = function() {
- if(testGroups.length == 0) {
- // Initialize.
- loadTestXML();
- } else if(currentTestIndex < testGroups[testGroupIndex].tests.length) {
- // We have tests left in this test group.
- var test = testGroups[testGroupIndex].tests[currentTestIndex++];
- var scriptCode = test.code;
- test.id = getIdFromPath(test.path);
- //var scriptCode = (test.firstChild.text != undefined) ?
- // test.firstChild.text : test.firstChild.textContent;
-
- loader.onTestReady(test, $.base64Decode(scriptCode));
- } else if(testGroupIndex < testGroups.length - 1) {
- // We don't have tests left in this test group, so move on
- // to the next.
- testGroupIndex++;
- getNextXML();
- } else {
- // We're done.
- loader.onTestsExhausted();
+ // If the file is loaded
+ if(testGroups[testGroupIndex].status == "loaded")
+ {
+ // And if we have tests left in this file
+ if(currentTestIndex < testGroups[testGroupIndex].tests.length) {
+ // Run the next test
+ var test = testGroups[testGroupIndex].tests[currentTestIndex++];
+ var scriptCode = test.code;
+ test.id = getIdFromPath(test.path);
+
+ loader.onTestReady(test, $.base64Decode(scriptCode));
+ }
+ // If there are no tests left and we aren't just running one file
+ else if(testGroupIndex < testGroups.length - 1 && mode !== "one") {
+ // And if we are running multiple chapters
+ if(mode == "multiple") {
+ var i = testGroupIndex + 1;
+ testGroupIndex = -1;
+ for(; i < testGroups.length && testGroupIndex == -1; i++) {
+ if(testGroups[i].selected === true) {
+ testGroupIndex = i;
+ }
+ }
+ if(testGroupIndex == -1) { // we couldn't find a test we haven't run yet
+ loader.onTestsExhausted();
+ return;
+ }
+ }
+ // And if
+ else {
+ // We don't have tests left in this test group, so move on
+ // to the next.
+ testGroupIndex++;
+ }
+ getNextXML();
+ }
+ //
+ else {
+ // We're done.
+ loader.onTestsExhausted();
+ }
+ }
+ else {
+ presenter.updateStatus("Loading test file: " + testGroups[testGroupIndex].path);
+ testGroups[testGroupIndex].onLoaded = getNextXML;
}
};
- /* Start over at the beginning */
+ /* Reset counters that track the next test (so we test from the beginning) */
this.reset = function() {
+ mode = "all";
currentTestIndex = 0;
testGroupIndex = 0;
};
-
-
-
+
+ /* Begin downloading test files. */
+ this.startLoadingTests = function() {
+ loadTestXML();
+ };
+
+ /* Prepare for testing a single chapter. */
+ this.setChapter = function(index) {
+ currentTestIndex = 0;
+ testGroupIndex = index;
+ mode = "one";
+
+ if(testGroups[index].status == 'loaded') {
+ loader.onInitialized(testGroups[index].tests.length);
+ }
+ else {
+ testGroups[index].status = 'priorityloading';
+ getFile(index);
+ loader.onInitialized(0);
+ }
+ };
+
+ /* Prepare for testing multiple chapters. Returns true if at least one chapter was selected. */
+ this.setMultiple = function() {
+ // Find the index of the first selection
+ var firstSelectedIndex = -1;
+ for(var i = 0; firstSelectedIndex == -1 && i < testGroups.length; i++) {
+ if(testGroups[i].selected) {
+ firstSelectedIndex = i;
+ }
+ }
+ // If we didn't find a selected index, just quit.
+ if(firstSelectedIndex == -1) {
+ return false;
+ }
+
+ // Begin loading the file immediately, if necessary
+ if(testGroups[firstSelectedIndex].status == 'waiting') {
+ getFile(firstSelectedIndex);
+ }
+
+ mode = "multiple";
+ testGroupIndex = firstSelectedIndex; // start at this chapter
+ currentTestIndex = 0; // start at test 0
+
+ // Count the number of tests
+ runningTests = 0;
+ for(var i = 0; i < testGroups.length; i++) {
+ runningTests += (testGroups[i].selected && testGroups[i].status == 'loaded') ? testGroups[i].tests.length : 0;
+ }
+ loader.onInitialized(runningTests);
+ return true;
+ };
+
+ this.getNumTestFiles = function() {
+ return testGroups.length;
+ };
+
+ /* Toggle the selection of a file. */
+ this.toggleSelection = function(index) {
+ testGroups[index].selected = !testGroups[index].selected;
+ }
+
}
/* Controls test generation and running, and sends results to the presenter. */
function Controller() {
- var state = 'stopped';
+ var state = 'undefined';
var runner = new BrowserRunner();
var loader = new TestLoader();
var controller = this;
@@ -357,67 +531,104 @@ function Controller() {
finished: function(elapsed) { }
};
+ /* Executes when a test case finishes executing. */
runner.onComplete = function(test) {
presenter.addTestResult(test);
try {
controller.implementerHook.addTestResult(test);
} catch(e) { /*no-op*/}
- if(state === 'running')
+ if(state === 'running') {
setTimeout(loader.getNextTest, 10);
+ }
};
+ /* Executes when the loader has been initialized. */
loader.onInitialized = function(totalTests) {
+ if(arguments.length == 0) {
+ totalTests = loader.totalTests;
+ }
presenter.setTotalTests(totalTests);
};
+
+ /* Executes when a test file starts loading. */
+ loader.onTestStartLoading = function(index, path) {
+ presenter.setTestLoading(index, path);
+ }
- loader.onLoadingNextSection = function(path) {
- presenter.updateStatus("Loading: " + path);
- };
-
+ /* Executes when a test is ready to run. */
loader.onTestReady = function(testObj, testSrc) {
presenter.updateStatus("Running Test: " + testObj.id);
- runner.run(testObj, testSrc);
+ elapsed += runner.run(testObj, testSrc);
};
+ /* Executes when there are no more tests to run. */
loader.onTestsExhausted = function() {
- state = 'stopped';
- elapsed += new Date() - startTime;
elapsed = elapsed/(1000*60); //minutes
- elapsed = elapsed.toFixed(1);
+ elapsed = elapsed.toFixed(3);
+
+ state = (loader.loadedFiles == loader.getNumTestFiles()) ? 'loaded' : 'loading';
+ presenter.setState(state);
presenter.finished(elapsed);
try {
controller.implementerHook.finished(elapsed);
} catch(e) { /*no-op*/}
};
-
+
+ /* Start the test execution. */
this.start = function() {
+ elapsed = 0;
state = 'running';
- startTime = new Date();
+ presenter.setState(state);
loader.getNextTest();
- presenter.started();
};
+ /* Pause the test execution. */
this.pause = function() {
- elapsed += new Date() - startTime;
state = 'paused';
- presenter.paused();
+ presenter.setState(state);
};
+ /* Reset the testing status. */
this.reset = function() {
- startTime = new Date();
- elapsed = 0;
+ loader.onInitialized();
loader.reset();
presenter.reset();
+
+ state = (loader.loadedFiles == loader.getNumTestFiles()) ? 'loaded' : 'loading';
+ presenter.setState(state);
};
-
- this.toggle = function() {
- if(state === 'running') {
- controller.pause();
- } else {
+
+ /* Start loading tests. */
+ this.startLoadingTests = function() {
+ state = 'loading';
+ presenter.setState(state);
+ loader.startLoadingTests();
+ }
+
+ /* Set the individual chapter in the laoder and start the controller. */
+ this.runIndividualTest = function(index) {
+ controller.reset();
+ loader.setChapter(index);
+ controller.start();
+ }
+
+ /* Compile a list of the selected tests and start the controller. */
+ this.runSelected = function() {
+ controller.reset();
+ if(loader.setMultiple()) {
controller.start();
}
- };
+ }
+
+ this.runAll = function() {
+ controller.reset();
+ controller.start();
+ }
+
+ this.toggleSelection = function(index) {
+ loader.toggleSelection(index);
+ }
}
var controller = new Controller();
@@ -474,17 +685,12 @@ $(function () {
});
});
- //Attach the click event to the start button. It starts, stops and
- //pauses the tests
- $('.button-start').click(function () {
- controller.toggle();
- });
-
- //Attach the click event to the reset button. It reset all the
- //test to zero
- $('.button-reset').click(function () {
- controller.reset();
- });
+ // Attach click events to all the control buttons.
+ $('#btnRunAll').click(controller.runAll);
+ $('#btnReset').click(controller.reset);
+ $('#btnRunSelected').click(controller.runSelected);
+ $('#btnPause').click(controller.pause);
+ $('#btnResume').click(controller.start);
var SUITE_DESCRIP_PATH = "json/suiteDescrip.json";
$.ajax({ url: SUITE_DESCRIP_PATH, dataType: 'json', success: function (data) {
@@ -492,4 +698,8 @@ $(function () {
presenter.setDate(data.date);
}
});
+
+ // Start loading the files right away.
+ controller.startLoadingTests();
+
});
diff --git a/tools/packaging/templates/runner.test262.html b/tools/packaging/templates/runner.test262.html
index 1c17ca39c..88c9b1afc 100644
--- a/tools/packaging/templates/runner.test262.html
+++ b/tools/packaging/templates/runner.test262.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
diff --git a/website/default.html b/website/default.html
index a7357f7ed..f363bb212 100644
--- a/website/default.html
+++ b/website/default.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
diff --git a/website/harness/helper.js b/website/harness/helper.js
index d44f3c329..1e97d4a90 100644
--- a/website/harness/helper.js
+++ b/website/harness/helper.js
@@ -34,30 +34,77 @@ function Presenter() {
}
}
+ /* Updates the displayed version. */
this.setVersion = function(v) {
version = v;
$(".targetTestSuiteVersion").text(v);
}
-
- this.setDate = function(d) {
+
+ /* Updates the displayed date. */
+ this.setDate = function(d) {
date = d;
$(".targetTestSuiteDate").text(d);
}
-
+
+ /* Updates the displayed number of tests to run. */
this.setTotalTests = function(tests) {
totalTests = tests;
$('#testsToRun').text(tests);
}
- /* Write status to the activity bar. */
+ /* Write status to the activity bar. */
this.updateStatus = function (str) {
this.activityBar.text(str);
}
-
- this.finished = function(elapsed) {
- $('.button-start').attr('src', 'images/start.png');
- $('.button-start').fadeOut('fast');
+
+ /* When starting to load a test, create a table row entry and buttons. Display file path. */
+ this.setTestWaiting = function(index, path) {
+ var appendMsg = '<tr class="waiting"><td height="29" class="chapterName">Waiting to load test file: ' + path + '</td>';
+ appendMsg += '<td width="83"><img src="images/select.png" alt="Select" title="Toggle the selection of this chapter." /></td>';
+ appendMsg += '<td width="83"><img src="images/run.png" alt="Run" title="Run this chapter individually." /></td></tr>';
+
+ $('#chapterSelector table').append(appendMsg);
+ // Find the table row
+ var tr = $('#chapterSelector table tr').filter(":last-child");
+ // Attach click listeners to the buttons
+ tr.find("img").filter('[alt="Select"]').bind("click", {tr: tr, index: index}, function(event) {
+ controller.toggleSelection(event.data.index);
+ // Deselect row
+ if(event.data.tr.hasClass("selectedChapter")) {
+ event.data.tr.removeClass("selectedChapter");
+ event.data.tr.find('img').filter('[alt="Selected"]').attr({
+ src: 'images/select.png',
+ alt: 'Select'
+ });
+ }
+ // Select row
+ else {
+ event.data.tr.addClass("selectedChapter");
+ event.data.tr.find('img').filter('[alt="Select"]').attr({
+ src: 'images/selected.png',
+ alt: 'Selected'
+ });
+ }
+ });
+ }
+
+ this.setTestLoading = function(index, path) {
+ var tr = $('#chapterSelector table tr').filter(":nth-child(" + (index+1) + ")");
+ tr.removeClass("waiting");
+ tr.addClass("loading");
+ tr.find(":first-child").html("Loading test file: " + path);
+ };
+
+ /* On test loaded, display the chapter name and the number of tests */
+ this.setTestLoaded = function(index, name, numTests) {
+ var tr = $('#chapterSelector table tr').filter(":nth-child(" + (index+1) + ")");
+ tr.removeClass("loading");
+ tr.find("td").filter(":first-child").html(name + " (" + numTests + " tests)");
+ }
+
+ /* Called when the tests finish executing. */
+ this.finished = function(elapsed) {
progressBar.find(".text").html("Testing complete!");
if (isSiteDebugMode()) {
this.activityBar.text('Overall Execution Time: ' + elapsed + ' minutes');
@@ -65,27 +112,19 @@ function Presenter() {
this.activityBar.text('');
}
}
-
- this.started = function () {
- $('.button-start').attr('src', 'images/pause.png');
- }
-
- this.paused = function () {
- $('.button-start').attr('src', 'images/resume.png');
- }
- this.reset = function() {
+ this.reset = function () {
globalSection.reset();
updateCounts();
+ this.activityBar.text('');
logger.empty();
currentSection = globalSection;
renderCurrentSection();
- $('.button-start').show();
}
- /* Do some setup tasks. */
+ /* Do some setup tasks. */
this.setup = function() {
backLink = $('#backlinkDiv');
backLink.click(goBack);
@@ -105,7 +144,29 @@ function Presenter() {
renderCurrentSection();
}
- //**IMPLEMENTATION DETAILS***************************************************
+ /* The state machine for the button display. */
+ this.setState = function(state) {
+ // Hide all the buttons
+ $('.progressBarButtons img').addClass("hide");
+ // Only show what is needed.
+ if(state == 'loading') {
+ $('#btnRunAll').removeClass('hide');
+ $('#btnRunSelected').removeClass('hide');
+ }
+ else if(state == 'paused') {
+ $('#btnResume').removeClass('hide');
+ $('#btnReset').removeClass('hide');
+ }
+ else if(state == 'running') {
+ $('#btnPause').removeClass('hide');
+ }
+ else if(state == 'loaded') {
+ $('#btnRunAll').removeClass('hide');
+ $('#btnRunSelected').removeClass('hide');
+ }
+ };
+
+ //**IMPLEMENTATION DETAILS***************************************************
/* Renders the current section into the report window. */
function renderCurrentSection() {
@@ -352,11 +413,11 @@ function Presenter() {
xml = '<testRun>\r\n' +
'<userAgent>' + window.navigator.userAgent + '</userAgent>\r\n' +
- '<Date>' + dateNow.toDateString() + '</Date>\r\n' +
- '<targetTestSuiteName>ECMAScript Test262 Site</targetTestSuiteName>\r\n' +
- '<targetTestSuiteVersion>' + version + '</targetTestSuiteVersion>\r\n' +
- '<targetTestSuiteDate>' + date + '</targetTestSuiteDate>\r\n' +
- ' <Tests>\r\n\r\n';
+ '<Date>' + dateNow.toDateString() + '</Date>\r\n' +
+ '<targetTestSuiteName>ECMAScript Test262 Site</targetTestSuiteName>\r\n' +
+ '<targetTestSuiteVersion>' + version + '</targetTestSuiteVersion>\r\n' +
+ '<targetTestSuiteDate>' + date + '</targetTestSuiteDate>\r\n' +
+ ' <Tests>\r\n\r\n';
reportWindow = window.open();
reportWindow.document.writeln("<title>ECMAScript Test262 XML</title>");
diff --git a/website/harness/sth.js b/website/harness/sth.js
index 91656937c..c2ce49371 100644
--- a/website/harness/sth.js
+++ b/website/harness/sth.js
@@ -85,6 +85,7 @@ function BrowserRunner() {
/* Run the test. */
this.run = function (test, code) {
+ var start = new Date();
//--Detect proper window.onerror support
if (instance.supportsWindowOnerror===undefined) {
@@ -121,7 +122,7 @@ function BrowserRunner() {
document.body.removeChild(iframePrereqs);
instance.run(test, code);
}, 500);
- return;
+ return 0; // initial config, ignore this timing.
}
currentTest = {};
@@ -207,6 +208,10 @@ function BrowserRunner() {
idoc.writeln(globalScopeContents);
idoc.writeln("</script>");
idoc.close();
+
+ var elapsed = new Date() - start;
+
+ return elapsed;
};
//--Helper functions-------------------------------------------------------
@@ -227,7 +232,7 @@ function BrowserRunner() {
*
* Callbacks:
* * onLoadingNextSection(path): Called after a request is sent for the next section json, with the path to that json.
- * * onInitialized(totalTests, version, date): Called after the testcases.json is loaded and parsed.
+ * * onInitialized(totalTests): Called after the testcases.json is loaded and parsed.
* * onTestReady(id, code): Called when a test is ready with the
* test's id and code.
* * onTestsExhausted(): Called when there are no more tests to run.
@@ -236,35 +241,33 @@ function TestLoader() {
var testGroups = [],
testGroupIndex = 0,
currentTestIndex = 0,
- loader = this;
+ loader = this,
+ mode = "all";
- this.version = undefined;
- this.date = undefined;
- this.totalTests = 0;
+ this.loadedFiles = 0;
+ this.version = undefined;
+ this.date = undefined;
+ this.totalTests = 0;
+ this.runningTests = 0;
/* Get the XML for the next section */
function getNextXML() {
- var group = testGroups[testGroupIndex];
currentTestIndex = 0;
- if(group.tests.length > 0) {
- // already loaded this section.
+ // already loaded this section.
+ if(testGroups[testGroupIndex].status == 'loaded') {
+ testGroups[testGroupIndex].onLoaded = function(){};
loader.getNextTest();
return;
}
- $.ajax({url: group.path, dataType: 'json', success: function(data) {
- group.tests = data.testsCollection.tests;
- loader.getNextTest();
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- //alert(XMLHttpRequest);
- }
-
- });
-
- loader.onLoadingNextSection(group.path);
+ // not loaded, so we attach a callback to come back here when the file loads.
+ else {
+ presenter.updateStatus("Loading file: " + testGroups[testGroupIndex].path);
+ testGroups[testGroupIndex].onLoaded = getNextXML;
+
+ }
}
-
+
/* Get the test list xml */
function loadTestXML() {
var testsListLoader = new XMLHttpRequest();
@@ -279,14 +282,99 @@ function TestLoader() {
for (var i = 0; i < testSuite.length; i++) {
testGroups[i] = {
path: testSuite[i],
- tests: []
+ tests: [],
+ selected: false,
+ status: 'waiting',
+ onLoaded: function(){}
};
+ presenter.setTestWaiting(i, testSuite[i]);
+
+ var tr = $('#chapterSelector table tr').filter(':nth-child(' + (i+1) + ')');
+ tr.find('img').filter('[alt="Run"]').bind('click', {index:i}, function(event){
+ controller.runIndividualTest(event.data.index);
+ });
}
loader.onInitialized(loader.totalTests);
- getNextXML();
+ getFile();
}});
}
+
+ /* Get the test file. Handles all the logic of figuring out the next file to load. */
+ function getFile(index) {
+ index = (arguments.length == 0) ? -1 : index;
+
+ // Look for selected waiting chapters (priority because you'll probably want to run them soon)
+ for(var i = 0; index == -1 && i < testGroups.length; i++) {
+ if(testGroups[i].status == 'waiting' && testGroups[i].selected) {
+ index = i;
+ }
+ }
+
+ // Look for just chapters waiting to be loaded.
+ for(var i = 0; index == -1 && i < testGroups.length; i++) {
+ if(testGroups[i].status == 'waiting') {
+ index = i;
+ }
+ }
+
+ if(index == -1) {
+ // Still -1? No more tests are waiting to be loaded then.
+ if(controller.state == 'loading') {
+ presenter.setState('loaded');
+ }
+ return;
+ }
+
+ presenter.setTestLoading(index, testGroups[index].path);
+ // the only other status that should be set when we get here is 'priorityloading'
+ if(testGroups[index].status == 'waiting') {
+ testGroups[index].status = 'loading';
+ }
+
+ loader.onTestStartLoading(index, testGroups[index].path);
+ // Create the AJAX call to grab the file.
+ $.ajax({
+ url: testGroups[index].path,
+ dataType: 'json',
+ // Callback with the chapter name and number of tests.
+ success: function(data, status, xhr) {
+ // Save the data for later usage
+ testGroups[index].tests = data.testsCollection.tests;
+ onTestLoaded(index, data.testsCollection.name, data.testsCollection.tests.length);
+ },
+ error: function(xhr, textStatus, errorThrown) {
+ // TODO: Catch this error and update UI accordingly. Unlikely to happen, but errors would be 404 or 5-- errors.
+
+ }
+ });
+ }
+
+ /* Executes when a test file finishes loading. */
+ function onTestLoaded(index, name, numTests) {
+ presenter.setTestLoaded(index, name, numTests);
+ if(testGroups[index].selected && mode == "multiple") {
+ loader.runningTests += numTests;
+ loader.onInitialized( loader.runningTests );
+ }
+
+ // The loading status is only assigned when downloading files in sequence, otherwise it
+ // gets the status of priorityloading. When loading out of order, we only want to download
+ // the single file, so we'll only tell it to get the next file when we see a status of
+ // loading.
+ if(testGroups[index].status == 'loading') {
+ getFile(); // triggers downloading the next file
+ testGroups[index].status = 'loaded';
+ }
+ else if(testGroups[index].status == 'priorityloading') {
+ // Run the test
+ testGroups[index].status = 'loaded';
+ loader.setChapter(index);
+ }
+
+ testGroups[index].onLoaded();
+ };
+
function getIdFromPath (path) {
//path is of the form "a/b/c.js"
@@ -304,42 +392,128 @@ function TestLoader() {
/* Move on to the next test */
this.getNextTest = function() {
- if(testGroups.length == 0) {
- // Initialize.
- loadTestXML();
- } else if(currentTestIndex < testGroups[testGroupIndex].tests.length) {
- // We have tests left in this test group.
- var test = testGroups[testGroupIndex].tests[currentTestIndex++];
- var scriptCode = test.code;
- test.id = getIdFromPath(test.path);
- //var scriptCode = (test.firstChild.text != undefined) ?
- // test.firstChild.text : test.firstChild.textContent;
-
- loader.onTestReady(test, $.base64Decode(scriptCode));
- } else if(testGroupIndex < testGroups.length - 1) {
- // We don't have tests left in this test group, so move on
- // to the next.
- testGroupIndex++;
- getNextXML();
- } else {
- // We're done.
- loader.onTestsExhausted();
+ // If the file is loaded
+ if(testGroups[testGroupIndex].status == "loaded")
+ {
+ // And if we have tests left in this file
+ if(currentTestIndex < testGroups[testGroupIndex].tests.length) {
+ // Run the next test
+ var test = testGroups[testGroupIndex].tests[currentTestIndex++];
+ var scriptCode = test.code;
+ test.id = getIdFromPath(test.path);
+
+ loader.onTestReady(test, $.base64Decode(scriptCode));
+ }
+ // If there are no tests left and we aren't just running one file
+ else if(testGroupIndex < testGroups.length - 1 && mode !== "one") {
+ // And if we are running multiple chapters
+ if(mode == "multiple") {
+ var i = testGroupIndex + 1;
+ testGroupIndex = -1;
+ for(; i < testGroups.length && testGroupIndex == -1; i++) {
+ if(testGroups[i].selected === true) {
+ testGroupIndex = i;
+ }
+ }
+ if(testGroupIndex == -1) { // we couldn't find a test we haven't run yet
+ loader.onTestsExhausted();
+ return;
+ }
+ }
+ // And if
+ else {
+ // We don't have tests left in this test group, so move on
+ // to the next.
+ testGroupIndex++;
+ }
+ getNextXML();
+ }
+ //
+ else {
+ // We're done.
+ loader.onTestsExhausted();
+ }
+ }
+ else {
+ presenter.updateStatus("Loading test file: " + testGroups[testGroupIndex].path);
+ testGroups[testGroupIndex].onLoaded = getNextXML;
}
};
- /* Start over at the beginning */
+ /* Reset counters that track the next test (so we test from the beginning) */
this.reset = function() {
+ mode = "all";
currentTestIndex = 0;
testGroupIndex = 0;
};
-
-
-
+
+ /* Begin downloading test files. */
+ this.startLoadingTests = function() {
+ loadTestXML();
+ };
+
+ /* Prepare for testing a single chapter. */
+ this.setChapter = function(index) {
+ currentTestIndex = 0;
+ testGroupIndex = index;
+ mode = "one";
+
+ if(testGroups[index].status == 'loaded') {
+ loader.onInitialized(testGroups[index].tests.length);
+ }
+ else {
+ testGroups[index].status = 'priorityloading';
+ getFile(index);
+ loader.onInitialized(0);
+ }
+ };
+
+ /* Prepare for testing multiple chapters. Returns true if at least one chapter was selected. */
+ this.setMultiple = function() {
+ // Find the index of the first selection
+ var firstSelectedIndex = -1;
+ for(var i = 0; firstSelectedIndex == -1 && i < testGroups.length; i++) {
+ if(testGroups[i].selected) {
+ firstSelectedIndex = i;
+ }
+ }
+ // If we didn't find a selected index, just quit.
+ if(firstSelectedIndex == -1) {
+ return false;
+ }
+
+ // Begin loading the file immediately, if necessary
+ if(testGroups[firstSelectedIndex].status == 'waiting') {
+ getFile(firstSelectedIndex);
+ }
+
+ mode = "multiple";
+ testGroupIndex = firstSelectedIndex; // start at this chapter
+ currentTestIndex = 0; // start at test 0
+
+ // Count the number of tests
+ runningTests = 0;
+ for(var i = 0; i < testGroups.length; i++) {
+ runningTests += (testGroups[i].selected && testGroups[i].status == 'loaded') ? testGroups[i].tests.length : 0;
+ }
+ loader.onInitialized(runningTests);
+ return true;
+ };
+
+ this.getNumTestFiles = function() {
+ return testGroups.length;
+ };
+
+ /* Toggle the selection of a file. */
+ this.toggleSelection = function(index) {
+ testGroups[index].selected = !testGroups[index].selected;
+ }
+
}
/* Controls test generation and running, and sends results to the presenter. */
function Controller() {
- var state = 'stopped';
+ var state = 'undefined';
var runner = new BrowserRunner();
var loader = new TestLoader();
var controller = this;
@@ -357,67 +531,104 @@ function Controller() {
finished: function(elapsed) { }
};
+ /* Executes when a test case finishes executing. */
runner.onComplete = function(test) {
presenter.addTestResult(test);
try {
controller.implementerHook.addTestResult(test);
} catch(e) { /*no-op*/}
- if(state === 'running')
+ if(state === 'running') {
setTimeout(loader.getNextTest, 10);
+ }
};
+ /* Executes when the loader has been initialized. */
loader.onInitialized = function(totalTests) {
+ if(arguments.length == 0) {
+ totalTests = loader.totalTests;
+ }
presenter.setTotalTests(totalTests);
};
+
+ /* Executes when a test file starts loading. */
+ loader.onTestStartLoading = function(index, path) {
+ presenter.setTestLoading(index, path);
+ }
- loader.onLoadingNextSection = function(path) {
- presenter.updateStatus("Loading: " + path);
- };
-
+ /* Executes when a test is ready to run. */
loader.onTestReady = function(testObj, testSrc) {
presenter.updateStatus("Running Test: " + testObj.id);
- runner.run(testObj, testSrc);
+ elapsed += runner.run(testObj, testSrc);
};
+ /* Executes when there are no more tests to run. */
loader.onTestsExhausted = function() {
- state = 'stopped';
- elapsed += new Date() - startTime;
elapsed = elapsed/(1000*60); //minutes
- elapsed = elapsed.toFixed(1);
+ elapsed = elapsed.toFixed(3);
+
+ state = (loader.loadedFiles == loader.getNumTestFiles()) ? 'loaded' : 'loading';
+ presenter.setState(state);
presenter.finished(elapsed);
try {
controller.implementerHook.finished(elapsed);
} catch(e) { /*no-op*/}
};
-
+
+ /* Start the test execution. */
this.start = function() {
+ elapsed = 0;
state = 'running';
- startTime = new Date();
+ presenter.setState(state);
loader.getNextTest();
- presenter.started();
};
+ /* Pause the test execution. */
this.pause = function() {
- elapsed += new Date() - startTime;
state = 'paused';
- presenter.paused();
+ presenter.setState(state);
};
+ /* Reset the testing status. */
this.reset = function() {
- startTime = new Date();
- elapsed = 0;
+ loader.onInitialized();
loader.reset();
presenter.reset();
+
+ state = (loader.loadedFiles == loader.getNumTestFiles()) ? 'loaded' : 'loading';
+ presenter.setState(state);
};
-
- this.toggle = function() {
- if(state === 'running') {
- controller.pause();
- } else {
+
+ /* Start loading tests. */
+ this.startLoadingTests = function() {
+ state = 'loading';
+ presenter.setState(state);
+ loader.startLoadingTests();
+ }
+
+ /* Set the individual chapter in the laoder and start the controller. */
+ this.runIndividualTest = function(index) {
+ controller.reset();
+ loader.setChapter(index);
+ controller.start();
+ }
+
+ /* Compile a list of the selected tests and start the controller. */
+ this.runSelected = function() {
+ controller.reset();
+ if(loader.setMultiple()) {
controller.start();
}
- };
+ }
+
+ this.runAll = function() {
+ controller.reset();
+ controller.start();
+ }
+
+ this.toggleSelection = function(index) {
+ loader.toggleSelection(index);
+ }
}
var controller = new Controller();
@@ -474,17 +685,12 @@ $(function () {
});
});
- //Attach the click event to the start button. It starts, stops and
- //pauses the tests
- $('.button-start').click(function () {
- controller.toggle();
- });
-
- //Attach the click event to the reset button. It reset all the
- //test to zero
- $('.button-reset').click(function () {
- controller.reset();
- });
+ // Attach click events to all the control buttons.
+ $('#btnRunAll').click(controller.runAll);
+ $('#btnReset').click(controller.reset);
+ $('#btnRunSelected').click(controller.runSelected);
+ $('#btnPause').click(controller.pause);
+ $('#btnResume').click(controller.start);
var SUITE_DESCRIP_PATH = "json/suiteDescrip.json";
$.ajax({ url: SUITE_DESCRIP_PATH, dataType: 'json', success: function (data) {
@@ -492,4 +698,8 @@ $(function () {
presenter.setDate(data.date);
}
});
+
+ // Start loading the files right away.
+ controller.startLoadingTests();
+
});
diff --git a/website/images/run.png b/website/images/run.png
new file mode 100644
index 000000000..068b505df
--- /dev/null
+++ b/website/images/run.png
Binary files differ
diff --git a/website/images/runall.png b/website/images/runall.png
new file mode 100644
index 000000000..4d16dbcdb
--- /dev/null
+++ b/website/images/runall.png
Binary files differ
diff --git a/website/images/runselected.png b/website/images/runselected.png
new file mode 100644
index 000000000..e3207bb68
--- /dev/null
+++ b/website/images/runselected.png
Binary files differ
diff --git a/website/images/select.png b/website/images/select.png
new file mode 100644
index 000000000..56e2024ff
--- /dev/null
+++ b/website/images/select.png
Binary files differ
diff --git a/website/images/selected.png b/website/images/selected.png
new file mode 100644
index 000000000..9c934e440
--- /dev/null
+++ b/website/images/selected.png
Binary files differ
diff --git a/website/styles/style.css b/website/styles/style.css
index a3a77f934..b9c01a7db 100644
--- a/website/styles/style.css
+++ b/website/styles/style.css
@@ -25,8 +25,8 @@ a
.logoHeader
{
- display:block;
- height:50px;
+ display:block;
+ height:50px;
}
.ecmascriptlogoBg
@@ -46,17 +46,17 @@ a
}
.ecmascriptbacklink
{
- position:relative;
+ position:relative;
}
.ecmascriptbacklink p
{
- position:absolute;
- right:0px;
+ position:absolute;
+ right:0px;
}
.ecmascriptbacklink a
{
font-weight:bold;
- font-size:0.9em;
+ font-size:0.9em;
}
.navBar
@@ -92,7 +92,7 @@ a
line-height: 60px;
padding-left: 20px;
padding-right: 20px;
- /* min-width: 160px; */
+ /* min-width: 160px; */
color: #fff;
text-decoration: none;
text-align: center;
@@ -180,7 +180,7 @@ li.content
position: relative;
color: black;
text-align: left;
- width: 602px;
+ width: 458px;
height: 23px;
margin-bottom: 5px;
float: left;
@@ -225,6 +225,11 @@ li.content
cursor: pointer;
}
+.progressBarButtons img.disabled
+{
+ cursor: not-allowed;
+}
+
/*ToDo: to be deleted*/
.ProgressBarCounter
{}
@@ -270,7 +275,7 @@ li.content
.reportTblHeader
{
padding: 5px;
- border-bottom: 1px dotted #999;
+ border-bottom: 1px dotted #999;
background-image: url(../images/tblreportheaderbg.png);
background-repeat: repeat-x;
color: #444;
@@ -307,7 +312,7 @@ li.content
.resultsTableHolder td.tblSectionHeader
{
padding: 5px;
- border-bottom: 1px dotted #999;
+ border-bottom: 1px dotted #999;
background-image: url(images/tblsectionheader.png);
background-repeat: repeat-x;
color: #f2a612;
@@ -346,7 +351,6 @@ li.content
.content-container { color: #444;}
.content-home, .content-dev, .content-tests, .content-results, .content-results-detailed, .content-browsers { display: none; }
.nav-link { cursor: pointer;}
-.button-start { }
.table-logger { overflow: scroll; }
#resultsTableHolder { overflow: auto; }
.log-row{ width: 100%; }
@@ -524,6 +528,40 @@ li.content
}
/* </Loading Indicator> */
+
+/* <Chapter Selection> */
+div#chapterSelector {
+ text-align: left;
+ font-size: 0.8em;
+ height: 150px;
+ border: 1px solid #CCC;
+ overflow: auto;
+ margin-bottom: 20px;
+}
+
+div#chapterSelector tr.selectedChapter {
+ font-weight:bold;
+}
+
+div#chapterSelector img {
+ cursor:pointer;
+}
+
+tr.loading, tr.waiting {
+ color:#999;
+}
+
+#chapterSelector .loading {
+ min-height:0;
+ background-position:2px center;
+}
+#chapterSelector tr.loading td.chapterName {
+ padding-left:20px;
+}
+
+/* </Chapter Selection> */
+
+
.hide
{
display: none;
@@ -550,7 +588,7 @@ li.content
}
.projectSection
{
- border-top:1px none #444;
- border-top-color: #444;
- border-top-style:solid;
-} \ No newline at end of file
+ border-top:1px none #444;
+ border-top-color: #444;
+ border-top-style:solid;
+}
diff --git a/website/testcases_ch07.html b/website/testcases_ch07.html
index 0f150dcfe..5302300a0 100644
--- a/website/testcases_ch07.html
+++ b/website/testcases_ch07.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
diff --git a/website/testcases_ch08.html b/website/testcases_ch08.html
index 94b0920e0..cb9254f8d 100644
--- a/website/testcases_ch08.html
+++ b/website/testcases_ch08.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
diff --git a/website/testcases_ch09.html b/website/testcases_ch09.html
index b5ae235bc..c323666ea 100644
--- a/website/testcases_ch09.html
+++ b/website/testcases_ch09.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
diff --git a/website/testcases_ch10.html b/website/testcases_ch10.html
index 9ebfdd93b..3d89bf866 100644
--- a/website/testcases_ch10.html
+++ b/website/testcases_ch10.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
diff --git a/website/testcases_ch11.html b/website/testcases_ch11.html
index e9a4d725e..be782aae1 100644
--- a/website/testcases_ch11.html
+++ b/website/testcases_ch11.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
diff --git a/website/testcases_ch12.html b/website/testcases_ch12.html
index 698758234..6d8e9eaf5 100644
--- a/website/testcases_ch12.html
+++ b/website/testcases_ch12.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
diff --git a/website/testcases_ch13.html b/website/testcases_ch13.html
index e4b978d94..6a6678dce 100644
--- a/website/testcases_ch13.html
+++ b/website/testcases_ch13.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
diff --git a/website/testcases_ch14.html b/website/testcases_ch14.html
index 75f72eb46..e7b02286b 100644
--- a/website/testcases_ch14.html
+++ b/website/testcases_ch14.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
diff --git a/website/testcases_ch15.html b/website/testcases_ch15.html
index 5ffb339b6..e0ffc04c4 100644
--- a/website/testcases_ch15.html
+++ b/website/testcases_ch15.html
@@ -93,31 +93,43 @@
<div class="content-tests">
<!-- This is the Main Content Container -->
- <p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
-<!--
- <div class="progressBarHolder">
- Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
- </div>
--->
+ <p class="content">Please click on the Run All button to run all the tests. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run. You may run individual tests by clicking the Run button next to the tests listed below. If you wish to run several chapters in sequence, but not the entire test suite, click the Select button for the chapters you wish to run and then click the Run Selected button.</p>
+
<!-- This is the Progress Bar Holder -->
<div class="progressBarHolder">
<div id="progressbar"></div>
<div class="progressBarButtons">
- <img src="images/reset.png" class="button-reset"/>&nbsp;<img src="images/start.png" class="button-start" id="btnStart"/>
+ <!-- Loading: Run All, Run Selected -->
+ <!-- Loaded: Run All, Run Selected -->
+ <!-- Running: Pause -->
+ <!-- Paused: Resume, Reset -->
+ <img src="images/runall.png" alt="Run All" title="Run all tests." id="btnRunAll" />
+ <img src="images/runselected.png" alt="Run Selected Tests" title="Run the tests selected below." id="btnRunSelected" />
+ <img src="images/pause.png" alt="Pause" title="Pause the running tests." id="btnPause" />
+ <img src="images/resume.png" alt="Resume" title="Resume the running tests." id="btnResume" />
+ <img src="images/reset.png" alt="Reset" title="Reset testing status." id="btnReset" />
</div>
<div style="clear: both;"></div>
</div>
- <p class="hide">>
+ <p class="hide">
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
</p>
+
<!-- This is the Results Text Holder -->
<div class="resultsHeader">
- <!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong>&nbsp;<span class="separator">|</span>
- Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
- <span class="separator">|</span>&nbsp;Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
+ Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span>
+ Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span>
+ Fail: <span class="fail" id="Fail"></span> <span class="separator">|</span>
+ Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
<p><span id="nextActivity"></span></p>
</div>
+
+ <!-- Test Chapter selector -->
+ <div id="chapterSelector">
+ <table width="100%" border="0" cellspacing="0" cellpadding="2"></table>
+ </div>
+
<!-- This is the Table -->
<div class="resultsTableHolder" id="tableLoggerParent">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>