// other security settings.
//
for (int i=0; i<scriptSource.length; i++) {
for (int j=0; j<secure.length; j++) {
for (int k=0; k<scriptOrigin.length; k++) {
SVGOnLoadExceptionTest t = buildTest(scripts,
scriptSource[i],
scriptOrigin[k],
secure[j],
false,
false);
addTest(t);
}
}
}
//
// If script run in restricted mode, then there should be
// a security exception, no matter what the other settings are
// (if we are running code under a security manager, that is,
// i.e., secure is true).
scripts = "text/ecmascript";
for (int i=0; i<scriptSource.length; i++) {
for (int k=0; k<scriptOrigin.length; k++) {
boolean expectSuccess = ((i>=2) && (k <= 2));
SVGOnLoadExceptionTest t = buildTest(scripts,
scriptSource[i],
scriptOrigin[k],
true,
true,
expectSuccess);
addTest(t);
}
}
//
// If "applicatin/ecmascript" is allowed, but the accepted
// script origin is lower than the candidate script, then
// the script should not be loaded (e.g., if scriptOrigin
// is embeded and trying to load an external script).
//
for (int j=0; j<scriptOrigin.length; j++) {
int max = j;
if (j == scriptOrigin.length - 1) {
max = j+1;
}
for (int i=0; i<max; i++) {
for (int k=0; k<secure.length; k++) {
SVGOnLoadExceptionTest t= buildTest(scripts, scriptSource[i],
scriptOrigin[j],
secure[k],
false,
false);
addTest(t);