[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:37 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7b9c7833ad6e83f9585a693d7a47c5bd6af0b677
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Oct 3 05:32:18 2010 +0000
2010-10-02 Simon Fraser <simon.fraser at apple.com>
Add the ability to jump to a specific test.
* CSSTestSuiteHarness/harness/harness.html:
* CSSTestSuiteHarness/harness/harness.js:
(TestSuite.prototype.goToTestByName):
(TestSuite.prototype.switchToFormat):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.html b/WebKitTools/CSSTestSuiteHarness/harness/harness.html
index e03385a..3877f49 100644
--- a/WebKitTools/CSSTestSuiteHarness/harness/harness.html
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.html
@@ -69,6 +69,20 @@
gTestSuite.goToNextIncompleteTest();
}
+ function goToTest()
+ {
+ var testName = prompt('Go to test:', '');
+
+ // This accepts any of the following:
+ // at-charset-010
+ // at-charset-010.xht
+ // xhtml1/at-charset-010
+ // xhtml1/at-charset-010.xht
+ // and will choose the format if specified.
+ if (!gTestSuite.goToTestByName(testName))
+ alert('Failed to find test ' + testName);
+ }
+
function formatChanged()
{
var newFormat;
@@ -159,6 +173,7 @@
<input type="radio" name="format" id="xhtml1" onchange="formatChanged()"><label for="xhtml1">XHTML1</label>
</div>
<button onclick="goToNextUntested()" accesskey="n"><strong>N</strong>ext Untested</button>
+ <button onclick="goToTest()" accesskey="g">Go to Test...</button>
</div>
</div>
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.js b/WebKitTools/CSSTestSuiteHarness/harness/harness.js
index 632d88d..2dd522e 100644
--- a/WebKitTools/CSSTestSuiteHarness/harness/harness.js
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.js
@@ -596,6 +596,64 @@ TestSuite.prototype.firstIncompleteTestIndex = function(chapter)
/* ------------------------------------------------------- */
+TestSuite.prototype.goToTestByName = function(testName)
+{
+ var match = testName.match(/^(?:(html4|xhtml1)\/)?([\w-_]+)(\.xht|\.htm)?/);
+ if (!match)
+ return false;
+
+ var prefix = match[1];
+ var testId = match[2];
+ var extension = match[3];
+
+ var format = this.format;
+ if (prefix)
+ format = prefix;
+ else if (extension) {
+ if (extension == kXHTML1Data.suffix)
+ format = kXHTML1Data.path;
+ else if (extension == kHTML4Data.suffix)
+ format = kHTML4Data.path;
+ }
+
+ this.switchToFormat(format);
+
+ var test = this.tests[testId];
+ if (!test)
+ return false;
+
+ // Find the first chapter.
+ var links = test.links.split(',');
+ if (links.length == 0) {
+ window.console.log('test ' + test.id + 'had no links.');
+ return false;
+ }
+
+ var firstLink = links[0];
+ var result = firstLink.match(/^([.\w]+)(#.+)?$/);
+ if (result)
+ firstLink = result[1];
+
+ // Find the chapter and index of the test.
+ for (var i = 0; i < kChapterData.length; ++i) {
+ var chapterData = kChapterData[i];
+ if (chapterData.file == firstLink) {
+
+ this.goToChapterIndex(i);
+
+ for (var j = 0; j < this.currentChapterTests.length; ++j) {
+ var currTest = this.currentChapterTests[j];
+ if (currTest.id == testId) {
+ this.goToTestIndex(j);
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
TestSuite.prototype.goToTestIndex = function(index)
{
if (index >= 0 && index < this.currentChapterTests.length) {
@@ -726,15 +784,6 @@ TestSuite.prototype.loadRef = function(test)
iframe.src = this.urlForTest(ref);
}
-TestSuite.prototype.loadTestByName = function(testName)
-{
- var currChapterInfo = this.chapterInfoMap[this.currChapterName];
-
- var testIndex = currChapterInfo.testNames.indexOf(testName);
- if (testIndex >= 0 && testIndex < currChapterInfo.testNames.length)
- this.goToTestIndex(testIndex);
-}
-
TestSuite.prototype.pathForTest = function(testName)
{
var prefix = this.formatInfo.path;
@@ -801,6 +850,16 @@ TestSuite.prototype.clearOutput = function()
/* ------------------------------------------------------- */
+TestSuite.prototype.switchToFormat = function(formatString)
+{
+ if (formatString == 'html4')
+ document.harness.format.html4.checked = true;
+ else
+ document.harness.format.xhtml1.checked = true;
+
+ this.formatChanged(formatString);
+}
+
TestSuite.prototype.formatChanged = function(formatString)
{
if (this.format == formatString)
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index e7bca44..77a2905 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,14 @@
2010-10-02 Simon Fraser <simon.fraser at apple.com>
+ Add the ability to jump to a specific test.
+
+ * CSSTestSuiteHarness/harness/harness.html:
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite.prototype.goToTestByName):
+ (TestSuite.prototype.switchToFormat):
+
+2010-10-02 Simon Fraser <simon.fraser at apple.com>
+
For a ref test, load the ref in the same format (HTML4 vs XHTML1)
as the test.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list