//**************************************************************************
//
//
// National Institute Of Standards and Technology
// DTS Version 1.1
//
// HTMLImageElement Interface
//**************************************************************************
function HTMLImageElement()
{
var tests = new Array (HTML0001HIE(),HTML0002HIE(),HTML0003HIE(),HTML0004HIE(),HTML0005HIE(),HTML0006HIE(),HTML0007HIE(),HTML0008HIE(),HTML0009HIE(),HTML0010HIE(),HTML0011HIE(),HTML0012HIE(),HTML0013HIE());
return tests;
}
//------------------------ test case HTML-0001HIE -------------------------
//
// Testing feature - The "lowSrc" attribute specifies the URI designating
// the source of this image.
//
// Testing approach - Retrieve the first IMG element of the testing document,
// then set its "lowSrc" attribute to:
// "./pix/dts.gif"
// Retrieve the attribute back and examine its value.
//
// Semantic Requirements: 1
//
// Last modification date - November 1, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0001HIE()
{
var computedValue = "";
var expectedValue = "./PIX/DTS.GIF";
var results = "";
var testNode = "";
results = new testResults("HTML0001HIE");
results.description = "The \"lowSrc\" attribute specifies the "+
"URI designating the source of this image for "+
"low-resolution output.";
//
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and set its "lowSrc" attribute.
//
testNode.node.lowSrc = "./PIX/DTS.GIF";
computedValue = testNode.node.lowSrc;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0001HIE --------------------------
//
//------------------------ test case HTML-0002HIE --------------------------
//
// Testing feature - The "name" attribute specifies the name of the
// element
//
// Testing approach - Retrieve the first IMG element and examine its
// "name" attribute. It should be equal to "IMAGE-1".
//
// Semantic Requirements: 2
//
// Last modification date - November 1, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0002HIE()
{
var computedValue = "";
var expectedValue = "IMAGE-1";
var results = "";
var testNode = "";
results = new testResults("HTML0002HIE");
results.description = "The \"name\" attribute specifies the "+
"name of the element.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and set its "name" attribute.
//
testNode.node.name = "image-1"
computedValue = testNode.node.name;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0002HIE --------------------------
//
//------------------------ test case HTML-0003HIE --------------------------
//
// Testing feature - The "align" attribute aligns this object with respect
// to its surrounding text.
//
// Testing approach - Retrieve the first IMG element and examine its
// "align" attribute. It should be equal to "MIDDLE".
//
// Semantic Requirements: 3
//
// Last modification date - August 5, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0003HIE()
{
var computedValue = "";
var expectedValue = "MIDDLE";
var results = "";
var testNode = "";
results = new testResults("HTML0003HIE");
results.description = "The \"align\" attribute specifies the "+
"alignment of this object with respect to "+
"the surrounding text.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "alt" attribute.
//
computedValue = testNode.node.align;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0003HIE --------------------------
//
//------------------------ test case HTML-0004HIE --------------------------
//
// Testing feature - The "alt" attribute specifies an alternate text for
// user agents not rendering the normal content of this
// element.
//
// Testing approach - Retrieve the first IMG element and examine its
// "alt" attribute. It should be equal to "DTS
// "IMAGE LOGO".
//
// Semantic Requirements: 4
//
// Last modification date - August 5, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0004HIE()
{
var computedValue = "";
var expectedValue = "DTS IMAGE LOGO";
var results = "";
var testNode = "";
results = new testResults("HTML0004HIE");
results.description = "The \"alt\" attribute specifies alternate "+
"text for user agents not rendering the normal "+
"content of this element.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "alt" attribute.
//
computedValue = testNode.node.alt;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0004HIE --------------------------
//
//------------------------ test case HTML-0005HIE --------------------------
//
// Testing feature - The "border" attribute specifies the width of the border
// around the image.
//
// Testing approach - Retrieve the first IMG element and examine its
// "border" attribute. It should be equal to "0".
//
// Semantic Requirements: 5
//
// Last modification date - August 9, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0005HIE()
{
var computedValue = "";
var expectedValue = "0";
var results = "";
var testNode = "";
results = new testResults("HTML0005HIE");
results.description = "The \"border\" attribute specifies the width "+
"of the border around this image.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "border" attribute.
//
computedValue = testNode.node.border;
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0005HIE --------------------------
//
//------------------------ test case HTML-0006HIE --------------------------
//
// Testing feature - The "height" attribute overrides the natural "height"
// of the image.
//
// Testing approach - Retrieve the first IMG element and examine its
// "height" attribute. It should be equal to "47".
//
// Semantic Requirements: 6
//
// Last modification date - August 9, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0006HIE()
{
var computedValue = "";
var expectedValue = "47";
var results = "";
var testNode = "";
results = new testResults("HTML0006HIE");
results.description = "The \"height\" attribute overrides the natural "+
"\"height\" of the image.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "height" attribute.
//
computedValue = testNode.node.height;
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0006HIE --------------------------
//
//------------------------ test case HTML-0007HIE --------------------------
//
// Testing feature - The "hspace" attribute specifies the horizontal space
// to the left and right of this image.
//
// Testing approach - Retrieve the first IMG element and examine its
// "hspace" attribute. It should be equal to "4".
//
// Semantic Requirements: 7
//
// Last modification date - August 9, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0007HIE()
{
var computedValue = "";
var expectedValue = "4";
var results = "";
var testNode = "";
results = new testResults("HTML0007HIE");
results.description = "The \"hspace\" attribute specifies the "+
"horizontal space to the left and right of "+
"this image.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "hspace" attribute.
//
computedValue = testNode.node.hspace;
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0007HIE --------------------------
//
//------------------------ test case HTML-0008HIE --------------------------
//
// Testing feature - The "isMap" attribute indicates the use of
// server-side image map.
//
// Testing approach - Retrieve the first IMG element and examine its
// "isMap" attribute. It should be equal to false.
//
// Semantic Requirements: 8
//
// Last modification date - August 9, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0008HIE()
{
var computedValue = "";
var expectedValue = false;
var results = "";
var testNode = "";
results = new testResults("HTML0008HIE");
results.description = "The \"isMap\" attribute specifies the "+
"use of a server-side image map.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "isMap" attribute.
//
computedValue = testNode.node.isMap;
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0008HIE --------------------------
//
//------------------------ test case HTML-0009HIE --------------------------
//
// Testing feature - The "longDesc" attribute contains a URI designating
// a long description of this image or frame..
//
// Testing approach - Retrieve the first IMG element and examine its
// "longDesc" attribute. It should be equal to
// "./FILES/DESC.HTML".
//
// Semantic Requirements: 9
//
// Last modification date - October 28, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0009HIE()
{
var computedValue = "";
var expectedValue = "./FILES/DESC.HTML";
var results = "";
var testNode = "";
results = new testResults("HTML0009HIE");
results.description = "The \"longDesc\" attribute specifies a "+
"URI designating a long description of "+
"this image or frame.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "longDesc" attribute.
//
computedValue = testNode.node.longDesc;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0009HIE --------------------------
//
//------------------------ test case HTML-0010HIE --------------------------
//
// Testing feature - The "src" attribute contains a URI designating
// the source of this image.
//
// Testing approach - Retrieve the first IMG element and examine its
// "src" attribute. It should be equal to
// "./PIX/DTS.GIF".
//
// Semantic Requirements: 10
//
// Last modification date - August 9, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0010HIE()
{
var computedValue = "";
var expectedValue = "./PIX/DTS.GIF";
var results = "";
var testNode = "";
results = new testResults("HTML0010HIE");
results.description = "The \"src\" attribute specifies a "+
"URI designating the source of this "+
"this image.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "src" attribute.
//
computedValue = testNode.node.src;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0010HIE --------------------------
//
//------------------------ test case HTML-0011HIE --------------------------
//
// Testing feature - The "useMap" attribute specifies the used client-side
// image map.
//
// Testing approach - Retrieve the first IMG element and examine its
// "useMap" attribute. It should be equal to
// "#DTS-MAP".
//
// Semantic Requirements: 11
//
// Last modification date - November 22, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0011HIE()
{
var computedValue = "";
var expectedValue = "#DTS-MAP";
var results = "";
var testNode = "";
results = new testResults("HTML0011HIE");
results.description = "The \"useMap\" attribute specifies the "+
"the used client-side image map.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "useMap" attribute.
//
computedValue = testNode.node.useMap;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0011HIE --------------------------
//
//------------------------ test case HTML-0012HIE --------------------------
//
// Testing feature - The "vspace" attribute specifies the vertical
// space above and below this image.
//
// Testing approach - Retrieve the first IMG element and examine its
// "vspace" attribute. It should be equal to
// "10".
//
// Semantic Requirements: 12
//
// Last modification date - August 10, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0012HIE()
{
var computedValue = "";
var expectedValue = "10";
var results = "";
var testNode = "";
results = new testResults("HTML0012HIE");
results.description = "The \"vspace\" attribute specifies the "+
"vertical space above and below this image.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "vspace" attribute.
//
computedValue = testNode.node.vspace;
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0012HIE --------------------------
//
//------------------------ test case HTML-0013HIE --------------------------
//
// Testing feature - The "width" attribute overrides the natural "width"
// of the image.
//
// Testing approach - Retrieve the first IMG element and examine its
// "width" attribute. It should be equal to "115".
//
// Semantic Requirements: 13
//
// Last modification date - October 28, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0013HIE()
{
var computedValue = "";
var expectedValue = "115";
var results = "";
var testNode = "";
results = new testResults("HTML0013HIE");
results.description = "The \"width\" attribute overrides the natural "+
"\"width\" of the image.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(IMG,FIRST);
//
// and access its "width" attribute.
//
computedValue = testNode.node.width;
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0013HIE --------------------------