[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
simon.fraser at apple.com
simon.fraser at apple.com
Wed Dec 22 13:54:02 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 579140acfcc933774cf9fda10d36775500dc13eb
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Sep 29 01:20:09 2010 +0000
2010-09-28 Simon Fraser <simon.fraser at apple.com>
No review.
Work around uncertainty about the order of database
transactions when creating the database, so that we don't
try to query the table before it has been created.
* CSSTestSuiteHarness/harness/harness.js:
(TestSuite):
(TestSuite.prototype.databaseCreated):
(TestSuite.prototype.storeTestResult):
(TestSuite.prototype.populateDatabaseFromTestInfoData):
(TestSuite.prototype.queryDatabaseForTestsWithStatus):
(TestSuite.prototype.queryDatabaseForTestsWithMixedStatus):
(TestSuite.prototype.queryDatabaseForCompletedTests):
(TestSuite.prototype.queryDatabaseForTestsNotRun):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68617 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.js b/WebKitTools/CSSTestSuiteHarness/harness/harness.js
index 34677f1..c95a6f9 100644
--- a/WebKitTools/CSSTestSuiteHarness/harness/harness.js
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.js
@@ -241,6 +241,8 @@ function TestSuite()
this.formatChanged('html4');
this.testInfoLoaded = false;
+
+ this.populatingDatabase = false;
var testInfoPath = kTestSuiteHome + kTestInfoDataFile;
this.loadTestInfo(testInfoPath);
@@ -884,9 +886,8 @@ TestSuite.prototype.openDatabase = function()
return;
}
- window.console.log('opening database')
var _self = this;
- this.db = window.openDatabase('css21testsuite', '1.0', 'CSS 2.1 test suite results', 10 * 1024 * 1024, function() {
+ this.db = window.openDatabase('css21testsuite12', '1.0', 'CSS 2.1 test suite results', 10 * 1024 * 1024, function() {
_self.databaseCreated();
}, errorHandler);
@@ -895,14 +896,14 @@ TestSuite.prototype.openDatabase = function()
TestSuite.prototype.databaseCreated = function(db)
{
- window.console.log('databaseCreated')
+ this.populatingDatabase = true;
+
var _self = this;
this.db.transaction(function (tx) {
// hstatus: HTML4 result
// xstatus: XHTML1 result
tx.executeSql('CREATE TABLE tests (test PRIMARY KEY UNIQUE, ref, title, flags, links, assertion, hstatus, hcomment, xstatus, xcomment)', null,
function(tx, results) {
- window.console.log('populating')
_self.populateDatabaseFromTestInfoData();
}, errorHandler);
});
@@ -914,7 +915,6 @@ TestSuite.prototype.storeTestResult = function(test, format, result, comment, us
return;
this.db.transaction(function (tx) {
- window.console.log('storing result ' + result + ' for ' + format);
if (format == 'html4')
tx.executeSql('UPDATE tests SET hstatus=?, hcomment=? WHERE test=?\n', [result, comment, test], null, errorHandler);
else if (format == 'xhtml1')
@@ -935,13 +935,21 @@ TestSuite.prototype.populateDatabaseFromTestInfoData = function(testInfoURL)
var currTest = _self.tests[testID];
tx.executeSql('INSERT INTO tests (test, ref, title, flags, links, assertion) VALUES (?, ?, ?, ?, ?, ?)', [currTest.id, currTest.reference, currTest.title, currTest.flags, currTest.links, currTest.assertion], null, errorHandler);
}
+
+ _self.populatingDatabase = false;
});
}
TestSuite.prototype.queryDatabaseForAllTests = function(sortKey, perRowHandler, completionHandler)
{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
var query;
var args = [];
if (sortKey != '') {
@@ -964,7 +972,13 @@ TestSuite.prototype.queryDatabaseForAllTests = function(sortKey, perRowHandler,
TestSuite.prototype.queryDatabaseForTestsWithStatus = function(status, perRowHandler, completionHandler)
{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
tx.executeSql('SELECT * FROM tests WHERE hstatus=? OR xstatus=?', [status, status], function(tx, results) {
var len = results.rows.length;
@@ -978,7 +992,13 @@ TestSuite.prototype.queryDatabaseForTestsWithStatus = function(status, perRowHan
TestSuite.prototype.queryDatabaseForTestsWithMixedStatus = function(perRowHandler, completionHandler)
{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
tx.executeSql('SELECT * FROM tests WHERE hstatus IS NOT NULL AND xstatus IS NOT NULL AND hstatus <> xstatus', [], function(tx, results) {
var len = results.rows.length;
@@ -992,9 +1012,16 @@ TestSuite.prototype.queryDatabaseForTestsWithMixedStatus = function(perRowHandle
TestSuite.prototype.queryDatabaseForCompletedTests = function(perRowHandler, completionHandler)
{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
this.db.transaction(function (tx) {
- tx.executeSql('SELECT * FROM tests WHERE hstatus IS NOT NULL AND xstatus IS NOT NULL', [], function(tx, results) {
+
+ if (_self.populatingDatabase)
+ return;
+ tx.executeSql('SELECT * FROM tests WHERE hstatus IS NOT NULL OR xstatus IS NOT NULL', [], function(tx, results) {
var len = results.rows.length;
for (var i = 0; i < len; ++i)
perRowHandler(results.rows.item(i));
@@ -1006,7 +1033,14 @@ TestSuite.prototype.queryDatabaseForCompletedTests = function(perRowHandler, com
TestSuite.prototype.queryDatabaseForTestsNotRun = function(perRowHandler, completionHandler)
{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+
tx.executeSql('SELECT * FROM tests WHERE hstatus IS NULL OR xstatus IS NULL', [], function(tx, results) {
var len = results.rows.length;
@@ -1060,12 +1094,15 @@ TestSuite.prototype.countTestsWithColumnValue = function(tx, completionHandler,
TestSuite.prototype.queryDatabaseForSummary = function(completionHandler)
{
- if (!this.db)
+ if (!this.db || this.populatingDatabase)
return;
var _self = this;
this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+
var allRowsCount = 'COUNT(*)';
var html4RowsCount = 'COUNT(hstatus)';
var xhtml1RowsCount = 'COUNT(xstatus)';
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index c828c6c..fd611e9 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-28 Simon Fraser <simon.fraser at apple.com>
+
+ No review.
+
+ Work around uncertainty about the order of database
+ transactions when creating the database, so that we don't
+ try to query the table before it has been created.
+
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite):
+ (TestSuite.prototype.databaseCreated):
+ (TestSuite.prototype.storeTestResult):
+ (TestSuite.prototype.populateDatabaseFromTestInfoData):
+ (TestSuite.prototype.queryDatabaseForTestsWithStatus):
+ (TestSuite.prototype.queryDatabaseForTestsWithMixedStatus):
+ (TestSuite.prototype.queryDatabaseForCompletedTests):
+ (TestSuite.prototype.queryDatabaseForTestsNotRun):
+
2010-09-28 Tony Chang <tony at chromium.org>
Reviewed by Eric Seidel.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list