[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 14:04:07 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 5a58f1440fc3dc0a5f0defcd03873e8b4976bee0
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Oct 2 06:01:29 2010 +0000

    2010-10-01  Simon Fraser  <simon.fraser at apple.com>
    
            Add the ability to remove results for re-testing, and
            to import results.
    
            * CSSTestSuiteHarness/harness/harness.css:
            (.custom button):
            (#overlay):
            (#overlay.visible):
            (.overlay-contents):
            (.overlay-contents textarea):
            (.overlay-contents .buttons):
            (.overlay-contents .note):
            (.overlay-contents .buttons button):
            * CSSTestSuiteHarness/harness/harness.html:
            * CSSTestSuiteHarness/harness/harness.js:
            (TestSuite.prototype.importResults):
            (TestSuite.prototype.clearResults):
            (TestSuite.prototype.markTestCompleted):
            (TestSuite.prototype.resetTestStatus):
            (TestSuite.prototype.storeTestResult):
            (TestSuite.prototype.importTestResults):
            (TestSuite.prototype.clearTestResults):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68973 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.css b/WebKitTools/CSSTestSuiteHarness/harness/harness.css
index ce3b583..a07eb10 100644
--- a/WebKitTools/CSSTestSuiteHarness/harness/harness.css
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.css
@@ -251,3 +251,51 @@ body {
   text-align: right;
   padding: 4px;
 }
+
+.custom button {
+  display: block;
+  margin: 12px 0;
+}
+
+/* Overlay */
+
+#overlay {
+  position: fixed;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  background-color: rgba(0, 0, 0, 0.6);
+  display: none;
+}
+
+#overlay.visible {
+  display: block;
+}
+
+.overlay-contents {
+  position: relative;
+  background-color: white;
+  margin: 50px auto;
+  width: 1000px;
+  padding: 20px;
+}
+
+.overlay-contents textarea {
+  width: 90em;
+  height: 50em;
+}
+.overlay-contents .buttons {
+  text-align: right;
+}
+
+.overlay-contents .note {
+  float: left;
+}
+
+.overlay-contents .buttons button {
+  font-size: 13px;
+  width: 6em;
+  margin: 12px 8px;
+}
+
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.html b/WebKitTools/CSSTestSuiteHarness/harness/harness.html
index ce86a23..e03385a 100644
--- a/WebKitTools/CSSTestSuiteHarness/harness/harness.html
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.html
@@ -104,36 +104,41 @@
       testFrame.contentWindow.print();
     }
 
-    /*
-    This conflicts badly with key handling in selects.
-    function keyHandler(event)
-    {
-      var charCode = String.fromCharCode(event.keyCode);
-      window.console.log('keyHandler')
-      switch (charCode) {
-        case 'P':
-          passTest();
-          break;
-
-        case 'F':
-          failTest();
-          break;
+    var gOverlayConfirmCallback;
+    function showOverlay(overlayConfirmCallback)
+    {
+      document.getElementById('overlay-data').value = '';
+      gOverlayConfirmCallback = overlayConfirmCallback;
+      $('#overlay').addClass('visible');
+    }
 
-        case 'I':
-          invalidTest();
-          break;
-          
-        case 'S':
-          skipTest();
-          break;
-      }
-      
-      event.stopPropagation();
-      event.preventDefault();
+    function overlayCancel()
+    {
+      $('#overlay').removeClass('visible');
     }
     
-    document.addEventListener('keyup', keyHandler, false);
-    */
+    function overlayConfirm()
+    {
+      var data = document.getElementById('overlay-data').value;
+      gOverlayConfirmCallback(data);
+      $('#overlay').removeClass('visible');
+    }
+    
+    function doImport()
+    {
+      document.getElementById('overlay-action').innerText = 'Enter results to import (in the same format as the exported results):';
+      showOverlay(function(data) {
+        gTestSuite.importResults(data);
+      });
+    }
+    
+    function doClear()
+    {
+      document.getElementById('overlay-action').innerText = 'Enter list of tests for which to clear results (so they can be re-tested):';
+      showOverlay(function(data) {
+        gTestSuite.clearResults(data);
+      });
+    }
   </script>
 
 </head>
@@ -195,12 +200,21 @@
   </div>
 
   <div class="results">
+
     <div class="output-options">
       <p>Show results for:</p>
       <select id="results-popup" onchange="resultsPopupChanged(this)">
       </select>
-      <button id="export-button" onclick="doExport()">Export...</button>
+      <div>
+        <button id="export-button" onclick="doExport()">Export...</button>
+      </div>
+
+      <div class="custom">
+        <button id="import-button" onclick="doImport()">Import...</button>
+        <button id="import-button" onclick="doClear()">Clear Results...</button>
+      </div>
     </div>
+
     <div id="output"></div>
     <div class="summary">
       <table>
@@ -217,5 +231,17 @@
     </div>
   </div>
 
+  <div id="overlay">
+    
+    <div class="overlay-contents">
+      <p id="overlay-action"></p>
+      <textarea id="overlay-data"></textarea>
+      <p class="note">Pasting many lines of text here can be very slow in Safari 5. You can quit Safari and use a <a href="http://nightly.webkit.org/" title="WebKit Nightly Builds">WebKit nightly build</a> for importing or clearing.</p>
+      <div class="buttons">
+        <button onclick="overlayCancel()">Cancel</button><button onclick="overlayConfirm()">OK</button>
+      </div>
+    </div>
+    
+  </div>
 </body>
 </html>
\ No newline at end of file
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.js b/WebKitTools/CSSTestSuiteHarness/harness/harness.js
index 6ed7f7f..9cfd4b4 100644
--- a/WebKitTools/CSSTestSuiteHarness/harness/harness.js
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.js
@@ -857,6 +857,93 @@ TestSuite.prototype.resultsPopupChanged = function(index)
   document.getElementById('export-button').disabled = !enableExport;
 }
 
+/* ------------------------- Import ------------------------------- */
+/*
+  Import format is the same as the export format, namely:
+  
+  testname<tab>result
+
+  with optional trailing <tab>comment.
+
+html4/absolute-non-replaced-height-002<tab>pass
+xhtml1/absolute-non-replaced-height-002<tab>?
+  
+  Lines starting with # are ignored.
+  The "testname<tab>result" line is ignored.
+*/
+TestSuite.prototype.importResults = function(data)
+{
+  var testsToImport = [];
+
+  var lines = data.split('\n');
+  for (var i = 0; i < lines.length; ++i) {
+    var currLine = lines[i];
+    if (currLine.length == 0 || currLine.charAt(0) == '#')
+      continue;
+
+    var match = currLine.match(/^(html4|xhtml1)\/([\w-_]+)\t([\w?]+)\t?(.+)?$/);
+    if (match) {
+      var test = { 'id' : match[2] };
+      test.format =  match[1];
+      test.result = match[3];
+      test.comment = match[4];
+      
+      if (test.result != '?')
+        testsToImport.push(test);
+    } else {
+      window.console.log('failed to match line \'' + currLine + '\'');
+    }
+  }
+
+  this.importTestResults(testsToImport);
+  
+  this.resetTestStatus();
+  this.updateSummaryData();
+}
+
+
+
+/* --------------------- Clear Results --------------------------- */
+/*
+  Clear results format is either same as the export format, or
+  a list of bare test IDs (e.g. absolute-non-replaced-height-001)
+  in which case both HTML4 and XHTML1 results are cleared.
+*/
+TestSuite.prototype.clearResults = function(data)
+{
+  var testsToClear = [];
+
+  var lines = data.split('\n');
+  for (var i = 0; i < lines.length; ++i) {
+    var currLine = lines[i];
+    if (currLine.length == 0 || currLine.charAt(0) == '#')
+      continue;
+
+    // Look for format/test with possible extension
+    var result = currLine.match(/^((html4|xhtml1)?)\/?([\w-_]+)/);
+    if (result) {
+      var testId = result[3];
+      var format = result[1];
+      
+      var clearHTML = format.length == 0 || format == 'html4';
+      var clearXHTML = format.length == 0 || format == 'xhtml1';
+      
+      var result = { 'id' : testId };
+      result.clearHTML = clearHTML;
+      result.clearXHTML = clearXHTML;
+
+      testsToClear.push(result);
+    } else {
+      window.console.log('failed to match line ' + currLine);
+    }
+  }
+  
+  this.clearTestResults(testsToClear);
+  
+  this.resetTestStatus();
+  this.updateSummaryData();
+}
+
 /* -------------------------------------------------------- */
 
 TestSuite.prototype.exportResultsCompletion = function(exportTests)
@@ -1100,7 +1187,7 @@ TestSuite.prototype.markTestCompleted = function(testID)
 {
   var test = this.tests[testID];
   if (!test) {
-    window.console.log('markTestCompleted to find test ' + testID);
+    window.console.log('markTestCompleted failed to find test ' + testID);
     return;
   }
   
@@ -1128,6 +1215,15 @@ TestSuite.prototype.loadTestStatus = function()
     this.updateChapterPopup();
 }
 
+TestSuite.prototype.resetTestStatus = function()
+{
+  for (var testID in this.tests) {
+    var currTest = this.tests[testID];
+    currTest.completed = false;
+  }
+  this.loadTestStatus();
+}
+
 /* -------------------------------------------------------- */
 
 TestSuite.prototype.updateSummaryData = function()
@@ -1210,7 +1306,48 @@ TestSuite.prototype.storeTestResult = function(test, format, result, comment, us
       tx.executeSql('UPDATE tests SET hstatus=?, hcomment=? WHERE test=?\n', [result, comment, test], null, errorHandler);
     else if (format == 'xhtml1')
       tx.executeSql('UPDATE tests SET xstatus=?, xcomment=? WHERE test=?\n', [result, comment, test], null, errorHandler);
-  });  
+  });
+}
+
+TestSuite.prototype.importTestResults = function(results)
+{
+  if (!this.db)
+    return;
+
+  this.db.transaction(function (tx) {
+
+    for (var i = 0; i < results.length; ++i) {
+      var currResult = results[i];
+
+      var query;
+      if (currResult.format == 'html4')
+        query = 'UPDATE tests SET hstatus=?, hcomment=? WHERE test=?\n';
+      else if (currResult.format == 'xhtml1')
+        query = 'UPDATE tests SET xstatus=?, xcomment=? WHERE test=?\n';
+
+      tx.executeSql(query, [currResult.result, currResult.comment, currResult.id], null, errorHandler);
+    }
+  });
+}
+
+TestSuite.prototype.clearTestResults = function(results)
+{
+  if (!this.db)
+    return;
+
+  this.db.transaction(function (tx) {
+    
+    for (var i = 0; i < results.length; ++i) {
+      var currResult = results[i];
+
+      if (currResult.clearHTML)
+        tx.executeSql('UPDATE tests SET hstatus=NULL, hcomment=NULL WHERE test=?\n', [currResult.id], null, errorHandler);
+
+      if (currResult.clearXHTML)
+        tx.executeSql('UPDATE tests SET xstatus=NULL, xcomment=NULL WHERE test=?\n', [currResult.id], null, errorHandler);
+      
+    }
+  });
 }
 
 TestSuite.prototype.populateDatabaseFromTestInfoData = function(testInfoURL)
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index bc3fb42..de19ad0 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,27 @@
+2010-10-01  Simon Fraser  <simon.fraser at apple.com>
+
+        Add the ability to remove results for re-testing, and
+        to import results.
+
+        * CSSTestSuiteHarness/harness/harness.css:
+        (.custom button):
+        (#overlay):
+        (#overlay.visible):
+        (.overlay-contents):
+        (.overlay-contents textarea):
+        (.overlay-contents .buttons):
+        (.overlay-contents .note):
+        (.overlay-contents .buttons button):
+        * CSSTestSuiteHarness/harness/harness.html:
+        * CSSTestSuiteHarness/harness/harness.js:
+        (TestSuite.prototype.importResults):
+        (TestSuite.prototype.clearResults):
+        (TestSuite.prototype.markTestCompleted):
+        (TestSuite.prototype.resetTestStatus):
+        (TestSuite.prototype.storeTestResult):
+        (TestSuite.prototype.importTestResults):
+        (TestSuite.prototype.clearTestResults):
+
 2010-10-01  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Jon Honeycutt.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list