//**************************************************************************
//
//
// National Institute Of Standards and Technology
// DTS Version 1.1
//
// HTMLLinkElement Interface
//**************************************************************************
function HTMLLinkElement()
{
var tests = new Array (HTML0001HLKE(),HTML0002HLKE(),HTML0003HLKE(),HTML0004HLKE(),HTML0005HLKE(),HTML0006HLKE(),HTML0007HLKE(),HTML0008HLKE(),HTML0009HLKE());
return tests;
}
//------------------------ test case HTML-0001HLKE -------------------------
//
// Testing feature - The "disabled" attribute enables/disables this
// link. This is currently only used by style sheets
// links.
//
// Testing approach - Retrieve the "disabled" attribute from the second LINK
// element of the testing document and examine its
// value. It should be equal to true.
//
// Semantic Requirements: 1
//
// Last modification date - November 1, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0001HLKE()
{
var computedValue = "";
var expectedValue = true;
var results = "";
var testNode = "";
results = new testResults("HTML0001HLKE");
results.description = "The \"disabled\" attribute enables/disables "+
"this list.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LINK,SECOND);
//
// and access its "disabled" attribute.
//
testNode.node.disabled=true;
computedValue = testNode.node.disabled;
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0001HLKE -------------------------
//
//------------------------ test case HTML-0002HLKE -------------------------
//
// Testing feature - The "charset" attribute specifies the charatcer
// encoding of the resource being linked to.
//
// Testing approach - Retrieve the "charset" attribute from the first LINK
// element of the testing document and examine its
// value. It should be equal to "Latin-1".
//
// Semantic Requirements: 2
//
// Last modification date - August 24, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0002HLKE()
{
var computedValue = "";
var expectedValue = "LATIN-1";
var results = "";
var testNode = "";
results = new testResults("HTML0002HLKE");
results.description = "The \"charset\" attribute specifies the "+
"character encoding of the document being "+
"linked to.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LINK,FIRST);
//
// and access its "charset" attribute.
//
computedValue = testNode.node.charset;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0002HLKE -------------------------
//
//------------------------ test case HTML-0003HLKE -------------------------
//
// Testing feature - The "href" attribute specifies the URI of the
// linked resource.
//
// Testing approach - Retrieve the "href" attribute from the first LINK
// element of the testing document and examine its
// value. It should be equal to "./files/Glossary.html".
//
// Semantic Requirements: 3
//
// Last modification date - August 24, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0003HLKE()
{
var computedValue = "";
var expectedValue = "./FILES/GLOSSARY.HTML";
var results = "";
var testNode = "";
results = new testResults("HTML0003HLKE");
results.description = "The \"href\" attribute specifies the "+
"URI of the linked resource.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LINK,FIRST);
//
// and access its "href" attribute.
//
computedValue = testNode.node.href;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0003HLKE -------------------------
//
//------------------------ test case HTML-0004HLKE -------------------------
//
// Testing feature - The "hreflang" attribute specifies the the language
// code of the linked resource.
//
// Testing approach - Retrieve the "hreflang" attribute from the first LINK
// element of the testing document and examine its
// value. It should be equal to "EN".
//
// Semantic Requirements: 4
//
// Last modification date - August 24, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0004HLKE()
{
var computedValue = "";
var expectedValue = "EN";
var results = "";
var testNode = "";
results = new testResults("HTML0004HLKE");
results.description = "The \"hreflang\" attribute specifies the "+
"language code of the linked resource.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LINK,FIRST);
//
// and access its "hreflang" attribute.
//
computedValue = testNode.node.hreflang;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0004HLKE -------------------------
//
//------------------------ test case HTML-0005HLKE -------------------------
//
// Testing feature - The "media" attribute specifies the the targeted
// media.
//
// Testing approach - Retrieve the "media" attribute from the first LINK
// element of the testing document and examine its
// value. It should be equal to "SCREEN".
//
// Semantic Requirements: 5
//
// Last modification date - August 24, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0005HLKE()
{
var computedValue = "";
var expectedValue = "SCREEN";
var results = "";
var testNode = "";
results = new testResults("HTML0005HLKE");
results.description = "The \"media\" attribute specifies the "+
"targeted media.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LINK,FIRST);
//
// and access its "media" attribute.
//
computedValue = testNode.node.media;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0005HLKE -------------------------
//
//------------------------ test case HTML-0006HLKE -------------------------
//
// Testing feature - The "rel" attribute specifies a forward link
// type.
//
// Testing approach - Retrieve the "rel" attribute from the first LINK
// element of the testing document and examine its
// value. It should be equal to "GLOSSARY".
//
// Semantic Requirements: 6
//
// Last modification date - August 24, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0006HLKE()
{
var computedValue = "";
var expectedValue = "GLOSSARY";
var results = "";
var testNode = "";
results = new testResults("HTML0006HLKE");
results.description = "The \"rel\" attribute specifies a "+
"forward link type.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LINK,FIRST);
//
// and access its "rel" attribute.
//
computedValue = testNode.node.rel;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0006HLKE -------------------------
//
//------------------------ test case HTML-0007HLKE -------------------------
//
// Testing feature - The "rev" attribute specifies a reverse link
// type.
//
// Testing approach - Retrieve the "rev" attribute from the third LINK
// element of the testing document and examine its
// value. It should be equal to "STYLESHEET".
//
// Semantic Requirements: 7
//
// Last modification date - August 24, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0007HLKE()
{
var computedValue = "";
var expectedValue = "STYLESHEET";
var results = "";
var testNode = "";
results = new testResults("HTML0007HLKE");
results.description = "The \"rev\" attribute specifies a "+
"reverse link type.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LINK,THIRD);
//
// and access its "rev" attribute.
//
computedValue = testNode.node.rev;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0007HLKE -------------------------
//
//------------------------ test case HTML-0008HLKE -------------------------
//
// Testing feature - The "target" attribute specifies the frame to render
// the resource in.
//
// Testing approach - Retrieve the "target" attribute from the first LINK
// element of the testing document and examine its
// value. It should be equal to "VIEWER"
//
// Semantic Requirements: 8
//
// Last modification date - August 24, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0008HLKE()
{
var computedValue = "";
var expectedValue = "VIEWER";
var results = "";
var testNode = "";
results = new testResults("HTML0008HLKE");
results.description = "The \"target\" attribute specifies the "+
"frame to render the resource in.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LINK,FIRST);
//
// and access its "target" attribute.
//
computedValue = testNode.node.target;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0008HLKE -------------------------
//
//------------------------ test case HTML-0009HLKE -------------------------
//
// Testing feature - The "type" attribute specifies the advisory content
// type.
//
// Testing approach - Retrieve the "type" attribute from the first LINK
// element of the testing document and examine its
// value. It should be equal to "TEXT/HTML".
//
// Semantic Requirements: 9
//
// Last modification date - August 24, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0009HLKE()
{
var computedValue = "";
var expectedValue = "TEXT/HTML";
var results = "";
var testNode = "";
results = new testResults("HTML0009HLKE");
results.description = "The \"type\" attribute specifies the "+
"advisory content type.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LINK,FIRST);
//
// and access its "type" attribute.
//
computedValue = testNode.node.type;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0009HLKE -------------------------