Commit ca0b0f3c authored by tkent's avatar tkent Committed by Commit bot

Remove fast/dom/HTMLDataGridElement.

All test in this directory are disabled, and the implementation and the
specification were removed some years ago.

This CL has no behavior changes.

BUG=685886
TBR=kochi@chromium.org

Review-Url: https://codereview.chromium.org/2676783002
Cr-Commit-Position: refs/heads/master@{#447967}
parent 144ab5c9
PASS: Initial value of datagrid.columns is defined.
PASS: Initial length of datagrid.columns is 0.
PASS: Column returned from add.
PASS: We have one column in the list.
PASS: The column at item(0) is the column we got back from add.
PASS: The column at index 0 is the column we got back from add.
PASS: The column when referenced by name is the one we got back from add.
PASS: The column's ID is fromcol as expected.
PASS: The column's label is From as expected.
PASS: The column's type is text as expected.
PASS: The column's primary property is true as expected.
PASS: The column's sortable property is 2 as expected.
PASS: The column returned from add is now the primary column.
<html>
<body>
<pre id="console"></pre>
<datagrid id="test"></datagrid>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function log(msg)
{
document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
}
try {
var datagrid = document.getElementById('test');
// Test initial value.
if (datagrid.columns != null) {
log("PASS: Initial value of datagrid.columns is defined.");
} else {
log("FAIL: Initial value of datagrid.columns was null.");
}
// Test initial length.
if (datagrid.columns.length == 0) {
log("PASS: Initial length of datagrid.columns is 0.");
} else {
log("FAIL: Initial length of datagrid.columns was " + datagrid.columns.length + ".");
}
// Test adding a column.
var column = datagrid.columns.add("fromcol", "From", "text", true, 2);
// Test return value from adding the column.
if (column != null) {
log("PASS: Column returned from add.");
} else {
log("FAIL: No column returned.");
}
// Make sure the column list now has one column.
if (datagrid.columns.length == 1) {
log("PASS: We have one column in the list.");
} else {
log("FAIL: Expected one column in the list but have " + datagrid.columns.length + " columns instead.");
}
// Use item(0) to make sure the column we got back from add is the one in the list.
var gotColumn = datagrid.columns.item(0);
if (gotColumn == column) {
log("PASS: The column at item(0) is the column we got back from add.");
} else {
log("FAIL: The column at item(0) (" + gotColumn + ") is not the one we expected (" + column + ").");
}
// Use [0] to make sure the column we got back from add is the one in the list.
gotColumn = datagrid.columns[0];
if (gotColumn == column) {
log("PASS: The column at index 0 is the column we got back from add.");
} else {
log("FAIL: The column at index 0 (" + gotColumn + ") is not the one we expected (" + column + ").");
}
gotColumn = datagrid.columns["fromcol"];
if (gotColumn == column) {
log("PASS: The column when referenced by name is the one we got back from add.");
} else {
log("FAIL: The column when referenced by name (" + gotColumn + ") is not the one we expected (" + column + ").");
}
// Examine the column's properties to make sure they are what we expected.
if (column.id == "fromcol") {
log("PASS: The column's ID is fromcol as expected.");
} else {
log("FAIL: The column's ID should be fromcol but is " + column.id + " instead.");
}
if (column.label == "From") {
log("PASS: The column's label is From as expected.");
} else {
log("FAIL: The column's label should be From but is " + column.label + " instead.");
}
if (column.type == "text") {
log("PASS: The column's type is text as expected.");
} else {
log("FAIL: The column's type should be text but is " + column.type + " instead.");
}
if (column.primary) {
log("PASS: The column's primary property is true as expected.");
} else {
log("FAIL: The column's primary property should be true but isn't.");
}
if (column.sortable == 2) {
log("PASS: The column's sortable property is 2 as expected.");
} else {
log("FAIL: The column's sortable property should be 2 but is " + column.sortable + " instead.");
}
// Make sure we got set as the primary column.
if (datagrid.columns.primaryColumn == column) {
log("PASS: The column returned from add is now the primary column.");
} else {
log("FAIL: The column is not the primary column as expected.");
}
} catch (exception) {
log("FAIL: Threw exception " + exception);
}
if (window.testRunner)
testRunner.notifyDone();
</script>
</body>
</html>
PASS: Initial value of datagrid.columns is defined.
PASS: Initial length of datagrid.columns is 2.
PASS: The column's ID is from as expected.
PASS: The column's label is From as expected.
PASS: The column's type is text as expected.
PASS: The column's primary property is true as expected.
PASS: The column's sortable property is 2 as expected.
PASS: The first column is the primary column.
<html>
<body>
<pre id="console"></pre>
<datagrid id="test"><dcol id="fromwrong" label="Fromwrong" type="progress"><dcol id="subject" label="Subject" type="text"></datagrid>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function log(msg)
{
document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
}
try {
var datagrid = document.getElementById('test');
// Test initial value.
if (datagrid.columns != null) {
log("PASS: Initial value of datagrid.columns is defined.");
} else {
log("FAIL: Initial value of datagrid.columns was null.");
}
// Test initial length.
if (datagrid.columns.length == 2) {
log("PASS: Initial length of datagrid.columns is 2.");
} else {
log("FAIL: Initial length of datagrid.columns was " + datagrid.columns.length + ".");
}
// Examine the first column's properties to make sure they are what we expected after
// we change the attributes using setAttribute calls.
datagrid.firstChild.setAttribute("id", "from");
datagrid.firstChild.setAttribute("label", "From");
datagrid.firstChild.setAttribute("type", "text");
datagrid.firstChild.setAttribute("primary", "true");
var column = datagrid.columns[0];
if (column.id == "from") {
log("PASS: The column's ID is from as expected.");
} else {
log("FAIL: The column's ID should be from but is " + column.id + " instead.");
}
if (column.label == "From") {
log("PASS: The column's label is From as expected.");
} else {
log("FAIL: The column's label should be From but is " + column.label + " instead.");
}
if (column.type == "text") {
log("PASS: The column's type is text as expected.");
} else {
log("FAIL: The column's type should be text but is " + column.type + " instead.");
}
if (column.primary) {
log("PASS: The column's primary property is true as expected.");
} else {
log("FAIL: The column's primary property should be true but isn't.");
}
if (column.sortable == 2) {
log("PASS: The column's sortable property is 2 as expected.");
} else {
log("FAIL: The column's sortable property should be 2 but is " + column.sortable + " instead.");
}
// Make sure the from column is the primary column.
if (datagrid.columns.primaryColumn == column) {
log("PASS: The first column is the primary column.");
} else {
log("FAIL: The first column is not the primary column as expected.");
}
} catch (exception) {
log("FAIL: Threw exception " + exception);
}
if (window.testRunner)
testRunner.notifyDone();
</script>
</body>
</html>
PASS: datagrid JS binding is [object HTMLDataGridElement]
PASS: Initial value of datagrid.columns is defined.
PASS: datagrid.columns JS binding is [object DataGridColumnList]
PASS: Initial length of datagrid.columns is 2.
PASS: newCol JS binding is [object HTMLDataGridColElement]
PASS: We have three columns in the list.
PASS: The column's ID is from as expected.
PASS: The column's label is From as expected.
PASS: The column's type is text as expected.
PASS: The column's primary property is true as expected.
PASS: The column's sortable property is 2 as expected.
PASS: The first column is the primary column.
PASS: After removing a column, the length of datagrid.columns is 2.
PASS: No column is the primary column.
<html>
<body>
<pre id="console"></pre>
<datagrid id="test"><dcol id="from" label="From" type="text" primary><dcol id="subject" label="Subject" type="text"></datagrid>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function log(msg)
{
document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
}
function expectBinding(what, obj, classname)
{
var desc = String(obj);
var expectedDesc = "[object " + classname + "]";
if (desc == expectedDesc) {
log("PASS: " + what + " JS binding is " + desc);
} else {
log("FAIL: " + what + " JS binding is " + desc + "(expected " + expectedDesc + ")");
}
}
try {
var datagrid = document.getElementById('test');
expectBinding("datagrid", datagrid, "HTMLDataGridElement");
// Test initial value.
if (datagrid.columns != null) {
log("PASS: Initial value of datagrid.columns is defined.");
} else {
log("FAIL: Initial value of datagrid.columns was null.");
}
// Test correct binding of DataGridColumnList.
expectBinding("datagrid.columns", datagrid.columns, "DataGridColumnList");
// Test initial length.
if (datagrid.columns.length == 2) {
log("PASS: Initial length of datagrid.columns is 2.");
} else {
log("FAIL: Initial length of datagrid.columns was " + datagrid.columns.length + ".");
}
// Test adding a column.
var newCol = document.createElement("dcol");
expectBinding("newCol", newCol, "HTMLDataGridColElement");
newCol.setAttribute("id", "date");
newCol.setAttribute("label", "Date Received");
newCol.setAttribute("type", "text");
var column = datagrid.appendChild(newCol);
// Make sure the column list now has three columns.
if (datagrid.columns.length == 3) {
log("PASS: We have three columns in the list.");
} else {
log("FAIL: Expected three columns in the list but have " + datagrid.columns.length + " columns instead.");
}
// Examine the first column's properties to make sure they are what we expected.
var column = datagrid.columns[0];
if (column.id == "from") {
log("PASS: The column's ID is from as expected.");
} else {
log("FAIL: The column's ID should be from but is " + column.id + " instead.");
}
if (column.label == "From") {
log("PASS: The column's label is From as expected.");
} else {
log("FAIL: The column's label should be From but is " + column.label + " instead.");
}
if (column.type == "text") {
log("PASS: The column's type is text as expected.");
} else {
log("FAIL: The column's type should be text but is " + column.type + " instead.");
}
if (column.primary) {
log("PASS: The column's primary property is true as expected.");
} else {
log("FAIL: The column's primary property should be true but isn't.");
}
if (column.sortable == 2) {
log("PASS: The column's sortable property is 2 as expected.");
} else {
log("FAIL: The column's sortable property should be 2 but is " + column.sortable + " instead.");
}
// Make sure the from column is the primary column.
if (datagrid.columns.primaryColumn == column) {
log("PASS: The first column is the primary column.");
} else {
log("FAIL: The first column is not the primary column as expected.");
}
// Yank the first column out.
datagrid.removeChild(datagrid.firstChild);
// Check the column count now.
if (datagrid.columns.length == 2) {
log("PASS: After removing a column, the length of datagrid.columns is 2.");
} else {
log("FAIL: After removing a column, the length of datagrid.columns is " + datagrid.columns.length + ".");
}
// There should no longer be a primary column.
if (!datagrid.columns.primaryColumn) {
log("PASS: No column is the primary column.");
} else {
log("FAIL: There is a primary column, but there should not be.");
}
} catch (exception) {
log("FAIL: Threw exception " + exception);
}
if (window.testRunner)
testRunner.notifyDone();
</script>
</body>
</html>
PASS: Initial value of datagrid.dataSource is null.
PASS: Allowed setting datagrid.dataSource to a number.
PASS: Allowed setting datagrid.dataSource to a string.
PASS: Allowed setting datagrid.dataSource to an object.
PASS: Allowed setting datagrid.dataSource to null.
<html>
<body>
<pre id="console"></pre>
<datagrid id="test"></datagrid>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function log(msg)
{
document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
}
try {
var datagrid = document.getElementById('test');
// Test setting the dataSource property and making sure the value of the property
// matches what we put in (using the === operator to check for exact equality.)
// Test initial value.
if (datagrid.dataSource === null) {
log("PASS: Initial value of datagrid.dataSource is null.");
} else {
log("FAIL: Initial value of datagrid.dataSource was not null. Was " + datagrid.dataSource + ".");
}
// Test setting to a JS number.
datagrid.dataSource = 10;
if (datagrid.dataSource === 10) {
log("PASS: Allowed setting datagrid.dataSource to a number.");
} else {
log("FAIL: Did not allow setting datagrid.dataSource to a number.");
}
// Test setting to a JS number.
datagrid.dataSource = "Test String";
if (datagrid.dataSource === "Test String") {
log("PASS: Allowed setting datagrid.dataSource to a string.");
} else {
log("FAIL: Did not allow setting datagrid.dataSource to a string.");
}
// Test setting dataSource to an object.
var dataSource = {};
datagrid.dataSource = dataSource;
if (datagrid.dataSource == dataSource) {
log("PASS: Allowed setting datagrid.dataSource to an object.");
} else {
log("FAIL: Did not allow setting datagrid.dataSource to an object.");
}
// Test setting dataSource to null.
datagrid.dataSource = null;
if (datagrid.dataSource === null) {
log("PASS: Allowed setting datagrid.dataSource to null.");
} else {
log("FAIL: Did not allow setting datagrid.dataSource to null.");
}
} catch (exception) {
log("FAIL: Threw exception " + exception);
}
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment