Rebuilt website.

This commit is contained in:
David Fugate 2011-09-12 13:34:49 -07:00
parent 807a3ba1b7
commit 33a175689e
9 changed files with 163 additions and 84 deletions

View File

@ -0,0 +1,79 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
function Test262Error(message) {
this.message = message;
}
Test262Error.prototype.toString = function () {
return "Test262 Error: " + this.message;
};
function testFailed(message) {
throw new Test262Error(message);
}
function testPrint(message) {
}
/**
* It is not yet clear that runTestCase should pass the global object
* as the 'this' binding in the call to testcase.
*/
var runTestCase = (function(global) {
return function(testcase) {
if (!testcase.call(global)) {
testFailed('test function returned falsy');
}
};
})(this);
function assertTruthy(value) {
if (!value) {
testFailed('test return falsy');
}
}
/**
* falsy means we expect no error.
* truthy means we expect some error.
* A non-empty string means we expect an error whose .name is that string.
*/
var expectedErrorName = false;
/**
* What was thrown, or the string 'Falsy' if something falsy was thrown.
* null if test completed normally.
*/
var actualError = null;
function testStarted(expectedErrName) {
expectedErrorName = expectedErrName;
}
function testFinished() {
var actualErrorName = actualError && (actualError.name ||
'SomethingThrown');
if (actualErrorName) {
if (expectedErrorName) {
if (typeof expectedErrorName === 'string') {
if (expectedErrorName === actualErrorName) {
return;
}
testFailed('Threw ' + actualErrorName +
' instead of ' + expectedErrorName);
}
return;
}
throw actualError;
}
if (expectedErrorName) {
if (typeof expectedErrorName === 'string') {
testFailed('Completed instead of throwing ' +
expectedErrorName);
}
testFailed('Completed instead of throwing');
}
}

View File

@ -2,16 +2,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
function SputnikError(message) {
function Test262Error(message) {
if (message) this.message = message;
}
SputnikError.prototype.toString = function () {
Test262Error.prototype.toString = function () {
return "Test262 Error: " + this.message;
};
function testFailed(message) {
throw new SputnikError(message);
throw new Test262Error(message);
}

View File

@ -1,4 +1,4 @@
/// Copyright (c) 2009 Microsoft Corporation
/// Copyright (c) 2009 Microsoft Corporation
///
/// Redistribution and use in source and binary forms, with or without modification, are permitted provided
/// that the following conditions are met:
@ -68,7 +68,7 @@ function BrowserRunner() {
currentTest.description = "Failed to load test case!";
} else if((typeof currentTest.error) !== "undefined") {
// We have an error logged from testRun.
if(currentTest.error instanceof SputnikError) {
if(currentTest.error instanceof Test262Error) {
currentTest.error = currentTest.message;
} else {
currentTest.error = currentTest.error.name + ": " + currentTest.error.message;
@ -123,7 +123,7 @@ function BrowserRunner() {
//TODO: these should be moved to sta.js
var includes = code.match(/\$INCLUDE\(([^\)]+)\)/g), // find all of the $INCLUDE statements
include;
iwin.SputnikError = SputnikError;
iwin.Test262Error = Test262Error;
iwin.$ERROR = $ERROR;
iwin.$FAIL = $FAIL;
iwin.$PRINT = function () {};
@ -139,8 +139,8 @@ function BrowserRunner() {
$.ajax({
async: false,
url: 'resources/scripts/global/' + include,
success: function(s) { scriptCache[include] = s }
})
success: function(s) { scriptCache[include] = s; }
});
}
// Finally, write the required script to the window.
@ -263,7 +263,7 @@ function TestLoader() {
testGroups[i] = {
path: testSuite[i],
tests: []
}
};
}
loader.onInitialized(loader.totalTests, loader.version, loader.date);
getNextXML();
@ -290,13 +290,13 @@ function TestLoader() {
// We're done.
loader.onTestsExhausted();
}
}
};
/* Start over at the beginning */
this.reset = function() {
currentTestIndex = 0;
testGroupIndex = 0;
}
};
@ -330,22 +330,22 @@ function Controller() {
if(state === 'running')
setTimeout(loader.getNextTest, 10);
}
};
loader.onInitialized = function(totalTests, version, date) {
presenter.setVersion(version);
presenter.setDate(date);
presenter.setTotalTests(totalTests);
}
};
loader.onLoadingNextSection = function(path) {
presenter.updateStatus("Loading: " + path);
}
};
loader.onTestReady = function(testObj, testSrc) {
presenter.updateStatus("Running Test: " + testObj.id);
runner.run(testObj, testSrc);
}
};
loader.onTestsExhausted = function() {
state = 'stopped';
@ -363,20 +363,20 @@ function Controller() {
startTime = new Date();
loader.getNextTest();
presenter.started();
}
};
this.pause = function() {
elapsed += new Date() - startTime;
state = 'paused';
presenter.paused();
}
};
this.reset = function() {
startTime = new Date();
elapsed = 0;
loader.reset();
presenter.reset();
}
};
this.toggle = function() {
if(state === 'running') {
@ -384,16 +384,16 @@ function Controller() {
} else {
controller.start();
}
}
};
}
var controller = new Controller()
var controller = new Controller();
/* Helper function which shows if we're in the 'debug' mode of the Test262 site.
This mode is only useful for debugging issues with the test harness and
website. */
function isSiteDebugMode() {
var str=window.location.href.substring(window.location.href.indexOf("?")+1)
var str=window.location.href.substring(window.location.href.indexOf("?")+1);
if(str.indexOf("sitedebug") > -1) {
return true;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
this.GlobalScopeTests = this.GlobalScopeTests || new Array();
this.GlobalScopeTests = this.GlobalScopeTests || {};
GlobalScopeTests["TestCases/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T1.js"]={"assertion":"White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \\u plus four hexadecimal digits","description":"Use TAB (U+0009)","negative":"."};
GlobalScopeTests["TestCases/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T2.js"]={"assertion":"White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \\u plus four hexadecimal digits","description":"Use VERTICAL TAB (U+000B)","negative":"."};
GlobalScopeTests["TestCases/07_Lexical_Conventions/7.2_White_Space/S7.2_A5_T3.js"]={"assertion":"White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \\u plus four hexadecimal digits","description":"Use FORM FEED (U+000C)","negative":"."};

File diff suppressed because one or more lines are too long