[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
rniwa at webkit.org
rniwa at webkit.org
Wed Dec 22 18:46:31 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 9e9ef41f11dfea0b263fca12c28ec46436c4bc65
Author: rniwa at webkit.org <rniwa at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 17 18:58:23 2010 +0000
2010-12-17 Ryosuke Niwa <rniwa at webkit.org>
Reviewed by Antonio Gomes.
editing/execCommand/toggle-compound-styles-expected should use LayoutTestController::setEditingBehavior
https://bugs.webkit.org/show_bug.cgi?id=51261
Modified the test to run each test case using each editing behavior, eliminating the need for
platform-specific expected results.
* editing/execCommand/script-tests/toggle-compound-styles.js:
(testSingleToggle):
* platform/gtk/editing/execCommand/toggle-compound-styles-expected.txt: Removed.
* platform/mac/editing/execCommand/toggle-compound-styles-expected.txt: Removed.
* platform/qt/editing/execCommand/toggle-compound-styles-expected.txt: Removed.
* platform/win/editing/execCommand/toggle-compound-styles-expected.txt: Removed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ccdc8c9..94146dc 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-12-17 Ryosuke Niwa <rniwa at webkit.org>
+
+ Reviewed by Antonio Gomes.
+
+ editing/execCommand/toggle-compound-styles-expected should use LayoutTestController::setEditingBehavior
+ https://bugs.webkit.org/show_bug.cgi?id=51261
+
+ Modified the test to run each test case using each editing behavior, eliminating the need for
+ platform-specific expected results.
+
+ * editing/execCommand/script-tests/toggle-compound-styles.js:
+ (testSingleToggle):
+ * platform/gtk/editing/execCommand/toggle-compound-styles-expected.txt: Removed.
+ * platform/mac/editing/execCommand/toggle-compound-styles-expected.txt: Removed.
+ * platform/qt/editing/execCommand/toggle-compound-styles-expected.txt: Removed.
+ * platform/win/editing/execCommand/toggle-compound-styles-expected.txt: Removed.
+
2010-12-17 Antonio Gomes <agomes at rim.com>
Unreviewed expectation result update.
diff --git a/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js b/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
index 45c4c5c..c1c7c73 100644
--- a/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
+++ b/LayoutTests/editing/execCommand/script-tests/toggle-compound-styles.js
@@ -4,33 +4,47 @@ var testContainer = document.createElement("div");
testContainer.contentEditable = true;
document.body.appendChild(testContainer);
-function testSingleToggle(toggleCommand, initialContents, expectedContents, dependsOnPlatform)
+function testSingleToggle(toggleCommand, initialContents, expectedContents)
{
testContainer.innerHTML = initialContents;
window.getSelection().selectAllChildren(testContainer);
document.execCommand(toggleCommand, false, null);
- if (!expectedContents)
- debug('<span>' + escapeHTML("one " + toggleCommand + " command converted " + initialContents + " to " + testContainer.innerHTML) + '</span>');
- else if (testContainer.innerHTML === expectedContents)
- testPassed("one " + toggleCommand + " command converted " + initialContents + " to " + expectedContents);
+ var action = 'one ' + toggleCommand + ' command converted "' + initialContents + '" to "' + expectedContents;
+ if (testContainer.innerHTML === expectedContents)
+ testPassed(action);
else
- testFailed("one " + toggleCommand + " command converted " + initialContents + " to " + testContainer.innerHTML + ", expected " + expectedContents);
+ testFailed(action + '", expected "' + expectedContents + '"');
}
-debug('PLATFORM-DEPENDENT TESTS');
-testSingleToggle("bold", "<u><b>hello</b> world</u>");
-testSingleToggle("bold", "<b>hello </b>world");
-testSingleToggle("bold", "<u><b>hello </b></u>world");
-testSingleToggle("italic", "<i>hello</i> <img>");
-testSingleToggle("italic", "<s><b>hello<i> world</i></b></s>");
-debug('PLATFORM-INDEPENDENT TESTS');
-testSingleToggle("bold", "<u><span id='test'><b>hello</b></span><b>world</b></u>", '<u><span id="test">hello</span>world</u>');
-testSingleToggle("bold", "<span id='test' style='font-weight:normal;'><b>hello</b></span>", '<span id="test">hello</span>');
-testSingleToggle("bold", "<div><b>hello</b><br><br><b>world</b></div>", "<div>hello<br><br>world</div>");
-testSingleToggle("italic", "<i>hello </i><img>", "hello <img>");
-testSingleToggle("italic", "<i><b>hello</b>world</i>", "<b>hello</b>world");
-testSingleToggle("italic", "<span style='font-style: normal;'> <i> hello </i> </span>", " hello ");
-testSingleToggle("italic", "<p><i>hello</i><span style='font-style:italic;'>world</span></p>", "<p>helloworld</p>");
+platforms = ['mac', 'win', 'unix'];
+
+for (var i = 0; i < platforms.length; i++) {
+ platform = platforms[i];
+ debug('Platform: ' + platform);
+
+ if (window.layoutTestController)
+ layoutTestController.setEditingBehavior(platform);
+
+ if (platform == 'win' || platform == 'unix')
+ platform = 'nonmac';
+
+ testSingleToggle("bold", "<u><b>hello</b> world</u>", {mac: '<u>hello world</u>', nonmac: '<u><b>hello world</b></u>'}[platform]);
+ testSingleToggle("bold", "<b>hello </b>world", {mac: 'hello world', nonmac: '<b>hello world</b>'}[platform]);
+ testSingleToggle("bold", "<u><b>hello </b></u>world", {mac: '<u>hello </u>world', nonmac: '<b><u>hello </u>world</b>'}[platform]);
+ testSingleToggle("italic", "<i>hello</i> <img>", {mac: 'hello <img>', nonmac: '<i>hello <img></i>'}[platform]);
+
+ // Following tests are cross-platform
+ testSingleToggle("bold", "<u><span id='test'><b>hello</b></span><b>world</b></u>", '<u><span id="test">hello</span>world</u>');
+ testSingleToggle("bold", "<span id='test' style='font-weight:normal;'><b>hello</b></span>", '<span id="test">hello</span>');
+ testSingleToggle("bold", "<div><b>hello</b><br><br><b>world</b></div>", "<div>hello<br><br>world</div>");
+ testSingleToggle("italic", "<i>hello </i><img>", "hello <img>");
+ testSingleToggle("italic", "<i><b>hello</b>world</i>", "<b>hello</b>world");
+ testSingleToggle("italic", "<span style='font-style: normal;'> <i> hello </i> </span>", " hello ");
+ testSingleToggle("italic", "<p><i>hello</i><span style='font-style:italic;'>world</span></p>", "<p>helloworld</p>");
+ testSingleToggle("italic", "<s><b>hello<i> world</i></b></s>", "<s><b><i>hello world</i></b></s>");
+
+ debug('');
+}
document.body.removeChild(testContainer);
diff --git a/LayoutTests/editing/execCommand/toggle-compound-styles-expected.txt b/LayoutTests/editing/execCommand/toggle-compound-styles-expected.txt
new file mode 100644
index 0000000..59286b9
--- /dev/null
+++ b/LayoutTests/editing/execCommand/toggle-compound-styles-expected.txt
@@ -0,0 +1,51 @@
+Test to make sure we can toggle text decorations correctly. The first three tests give different result on mac only.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Platform: mac
+PASS one bold command converted "<u><b>hello</b> world</u>" to "<u>hello world</u>
+PASS one bold command converted "<b>hello </b>world" to "hello world
+PASS one bold command converted "<u><b>hello </b></u>world" to "<u>hello </u>world
+PASS one italic command converted "<i>hello</i> <img>" to "hello <img>
+PASS one bold command converted "<u><span id='test'><b>hello</b></span><b>world</b></u>" to "<u><span id="test">hello</span>world</u>
+PASS one bold command converted "<span id='test' style='font-weight:normal;'><b>hello</b></span>" to "<span id="test">hello</span>
+PASS one bold command converted "<div><b>hello</b><br><br><b>world</b></div>" to "<div>hello<br><br>world</div>
+PASS one italic command converted "<i>hello </i><img>" to "hello <img>
+PASS one italic command converted "<i><b>hello</b>world</i>" to "<b>hello</b>world
+PASS one italic command converted "<span style='font-style: normal;'> <i> hello </i> </span>" to " hello
+PASS one italic command converted "<p><i>hello</i><span style='font-style:italic;'>world</span></p>" to "<p>helloworld</p>
+PASS one italic command converted "<s><b>hello<i> world</i></b></s>" to "<s><b><i>hello world</i></b></s>
+
+Platform: win
+PASS one bold command converted "<u><b>hello</b> world</u>" to "<u><b>hello world</b></u>
+PASS one bold command converted "<b>hello </b>world" to "<b>hello world</b>
+PASS one bold command converted "<u><b>hello </b></u>world" to "<b><u>hello </u>world</b>
+PASS one italic command converted "<i>hello</i> <img>" to "<i>hello <img></i>
+PASS one bold command converted "<u><span id='test'><b>hello</b></span><b>world</b></u>" to "<u><span id="test">hello</span>world</u>
+PASS one bold command converted "<span id='test' style='font-weight:normal;'><b>hello</b></span>" to "<span id="test">hello</span>
+PASS one bold command converted "<div><b>hello</b><br><br><b>world</b></div>" to "<div>hello<br><br>world</div>
+PASS one italic command converted "<i>hello </i><img>" to "hello <img>
+PASS one italic command converted "<i><b>hello</b>world</i>" to "<b>hello</b>world
+PASS one italic command converted "<span style='font-style: normal;'> <i> hello </i> </span>" to " hello
+PASS one italic command converted "<p><i>hello</i><span style='font-style:italic;'>world</span></p>" to "<p>helloworld</p>
+PASS one italic command converted "<s><b>hello<i> world</i></b></s>" to "<s><b><i>hello world</i></b></s>
+
+Platform: unix
+PASS one bold command converted "<u><b>hello</b> world</u>" to "<u><b>hello world</b></u>
+PASS one bold command converted "<b>hello </b>world" to "<b>hello world</b>
+PASS one bold command converted "<u><b>hello </b></u>world" to "<b><u>hello </u>world</b>
+PASS one italic command converted "<i>hello</i> <img>" to "<i>hello <img></i>
+PASS one bold command converted "<u><span id='test'><b>hello</b></span><b>world</b></u>" to "<u><span id="test">hello</span>world</u>
+PASS one bold command converted "<span id='test' style='font-weight:normal;'><b>hello</b></span>" to "<span id="test">hello</span>
+PASS one bold command converted "<div><b>hello</b><br><br><b>world</b></div>" to "<div>hello<br><br>world</div>
+PASS one italic command converted "<i>hello </i><img>" to "hello <img>
+PASS one italic command converted "<i><b>hello</b>world</i>" to "<b>hello</b>world
+PASS one italic command converted "<span style='font-style: normal;'> <i> hello </i> </span>" to " hello
+PASS one italic command converted "<p><i>hello</i><span style='font-style:italic;'>world</span></p>" to "<p>helloworld</p>
+PASS one italic command converted "<s><b>hello<i> world</i></b></s>" to "<s><b><i>hello world</i></b></s>
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/editing/execCommand/toggle-compound-styles-expected.txt b/LayoutTests/platform/gtk/editing/execCommand/toggle-compound-styles-expected.txt
deleted file mode 100644
index c2e7986..0000000
--- a/LayoutTests/platform/gtk/editing/execCommand/toggle-compound-styles-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Test to make sure we can toggle text decorations correctly. The first three tests give different result on mac only.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PLATFORM-DEPENDENT TESTS
-one bold command converted <u><b>hello</b> world</u> to <u><b>hello world</b></u>
-one bold command converted <b>hello </b>world to <b>hello world</b>
-one bold command converted <u><b>hello </b></u>world to <b><u>hello </u>world</b>
-one italic command converted <i>hello</i> <img> to <i>hello <img></i>
-one italic command converted <s><b>hello<i> world</i></b></s> to <s><b><i>hello world</i></b></s>
-PLATFORM-INDEPENDENT TESTS
-PASS one bold command converted <u><span id='test'><b>hello</b></span><b>world</b></u> to <u><span id="test">hello</span>world</u>
-PASS one bold command converted <span id='test' style='font-weight:normal;'><b>hello</b></span> to <span id="test">hello</span>
-PASS one bold command converted <div><b>hello</b><br><br><b>world</b></div> to <div>hello<br><br>world</div>
-PASS one italic command converted <i>hello </i><img> to hello <img>
-PASS one italic command converted <i><b>hello</b>world</i> to <b>hello</b>world
-PASS one italic command converted <span style='font-style: normal;'> <i> hello </i> </span> to hello
-PASS one italic command converted <p><i>hello</i><span style='font-style:italic;'>world</span></p> to <p>helloworld</p>
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/platform/mac/editing/execCommand/toggle-compound-styles-expected.txt b/LayoutTests/platform/mac/editing/execCommand/toggle-compound-styles-expected.txt
deleted file mode 100644
index b989b76..0000000
--- a/LayoutTests/platform/mac/editing/execCommand/toggle-compound-styles-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Test to make sure we can toggle text decorations correctly. The first three tests give different result on mac only.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PLATFORM-DEPENDENT TESTS
-one bold command converted <u><b>hello</b> world</u> to <u>hello world</u>
-one bold command converted <b>hello </b>world to hello world
-one bold command converted <u><b>hello </b></u>world to <u>hello </u>world
-one italic command converted <i>hello</i> <img> to hello <img>
-one italic command converted <s><b>hello<i> world</i></b></s> to <s><b><i>hello world</i></b></s>
-PLATFORM-INDEPENDENT TESTS
-PASS one bold command converted <u><span id='test'><b>hello</b></span><b>world</b></u> to <u><span id="test">hello</span>world</u>
-PASS one bold command converted <span id='test' style='font-weight:normal;'><b>hello</b></span> to <span id="test">hello</span>
-PASS one bold command converted <div><b>hello</b><br><br><b>world</b></div> to <div>hello<br><br>world</div>
-PASS one italic command converted <i>hello </i><img> to hello <img>
-PASS one italic command converted <i><b>hello</b>world</i> to <b>hello</b>world
-PASS one italic command converted <span style='font-style: normal;'> <i> hello </i> </span> to hello
-PASS one italic command converted <p><i>hello</i><span style='font-style:italic;'>world</span></p> to <p>helloworld</p>
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/platform/qt/editing/execCommand/toggle-compound-styles-expected.txt b/LayoutTests/platform/qt/editing/execCommand/toggle-compound-styles-expected.txt
deleted file mode 100644
index c2e7986..0000000
--- a/LayoutTests/platform/qt/editing/execCommand/toggle-compound-styles-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Test to make sure we can toggle text decorations correctly. The first three tests give different result on mac only.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PLATFORM-DEPENDENT TESTS
-one bold command converted <u><b>hello</b> world</u> to <u><b>hello world</b></u>
-one bold command converted <b>hello </b>world to <b>hello world</b>
-one bold command converted <u><b>hello </b></u>world to <b><u>hello </u>world</b>
-one italic command converted <i>hello</i> <img> to <i>hello <img></i>
-one italic command converted <s><b>hello<i> world</i></b></s> to <s><b><i>hello world</i></b></s>
-PLATFORM-INDEPENDENT TESTS
-PASS one bold command converted <u><span id='test'><b>hello</b></span><b>world</b></u> to <u><span id="test">hello</span>world</u>
-PASS one bold command converted <span id='test' style='font-weight:normal;'><b>hello</b></span> to <span id="test">hello</span>
-PASS one bold command converted <div><b>hello</b><br><br><b>world</b></div> to <div>hello<br><br>world</div>
-PASS one italic command converted <i>hello </i><img> to hello <img>
-PASS one italic command converted <i><b>hello</b>world</i> to <b>hello</b>world
-PASS one italic command converted <span style='font-style: normal;'> <i> hello </i> </span> to hello
-PASS one italic command converted <p><i>hello</i><span style='font-style:italic;'>world</span></p> to <p>helloworld</p>
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/platform/win/editing/execCommand/toggle-compound-styles-expected.txt b/LayoutTests/platform/win/editing/execCommand/toggle-compound-styles-expected.txt
deleted file mode 100644
index c2e7986..0000000
--- a/LayoutTests/platform/win/editing/execCommand/toggle-compound-styles-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Test to make sure we can toggle text decorations correctly. The first three tests give different result on mac only.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PLATFORM-DEPENDENT TESTS
-one bold command converted <u><b>hello</b> world</u> to <u><b>hello world</b></u>
-one bold command converted <b>hello </b>world to <b>hello world</b>
-one bold command converted <u><b>hello </b></u>world to <b><u>hello </u>world</b>
-one italic command converted <i>hello</i> <img> to <i>hello <img></i>
-one italic command converted <s><b>hello<i> world</i></b></s> to <s><b><i>hello world</i></b></s>
-PLATFORM-INDEPENDENT TESTS
-PASS one bold command converted <u><span id='test'><b>hello</b></span><b>world</b></u> to <u><span id="test">hello</span>world</u>
-PASS one bold command converted <span id='test' style='font-weight:normal;'><b>hello</b></span> to <span id="test">hello</span>
-PASS one bold command converted <div><b>hello</b><br><br><b>world</b></div> to <div>hello<br><br>world</div>
-PASS one italic command converted <i>hello </i><img> to hello <img>
-PASS one italic command converted <i><b>hello</b>world</i> to <b>hello</b>world
-PASS one italic command converted <span style='font-style: normal;'> <i> hello </i> </span> to hello
-PASS one italic command converted <p><i>hello</i><span style='font-style:italic;'>world</span></p> to <p>helloworld</p>
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list