Bug 598289 - Test case for CF_HTML parsing with StartHTML/EndHTML set to -1. r=ehsan
authorBrian R. Bondy <netzen@gmail.com>
Wed, 21 Sep 2011 13:22:54 -0400
changeset 77279 9e3562fefd4ca1970d8f7ba430b582e7dc6092bb
parent 77278 b7486f31f6b1d29d60098ba74bc2ba0c0e2d17c5
child 77280 c67ec721fdd67b1b776ffdda5c627ae127a685c9
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersehsan
bugs598289
milestone9.0a1
Bug 598289 - Test case for CF_HTML parsing with StartHTML/EndHTML set to -1. r=ehsan
editor/libeditor/html/tests/Makefile.in
editor/libeditor/html/tests/data/cfhtml-nocontext.txt
editor/libeditor/html/tests/test_CF_HTML_clipboard.html
--- a/editor/libeditor/html/tests/Makefile.in
+++ b/editor/libeditor/html/tests/Makefile.in
@@ -98,16 +98,17 @@ include $(topsrcdir)/config/rules.mk
 		test_root_element_replacement.html \
 		$(NULL)
 
 _DATA_FILES = \
 		data/cfhtml-chromium.txt \
 		data/cfhtml-firefox.txt \
 		data/cfhtml-ie.txt \
 		data/cfhtml-ooo.txt \
+		data/cfhtml-nocontext.txt \
 		$(NULL)
 
 _CHROME_TEST_FILES = \
 		test_contenteditable_text_input_handling.html \
 		test_bug489202.xul \
 		test_bug490879.xul \
 		test_bug607584.xul \
 		test_bug616590.xul \
new file mode 100644
--- /dev/null
+++ b/editor/libeditor/html/tests/data/cfhtml-nocontext.txt
@@ -0,0 +1,18 @@
+Version:0.9
+StartHTML:-1
+EndHTML:-1
+StartFragment:0000000111
+EndFragment:0000000246
+<!--StartFragment-->
+<html>
+  <head>
+    <title>Test</title>
+    
+  </head>
+  <body>
+    <p>
+      3.<b>1415926535897932</b>
+    </p>
+  </body>
+</html>
+<!--EndFragment-->
--- a/editor/libeditor/html/tests/test_CF_HTML_clipboard.html
+++ b/editor/libeditor/html/tests/test_CF_HTML_clipboard.html
@@ -84,16 +84,18 @@ var gTests = [
   // Copied from Firefox
   {fileName: "cfhtml-firefox.txt", expected: "Firefox"},
   // Copied from OpenOffice.org
   {fileName: "cfhtml-ooo.txt", expected: "hello"},
   // Copied from IE
   {fileName: "cfhtml-ie.txt", expected: "browser"},
   // Copied from Chromium
   {fileName: "cfhtml-chromium.txt", expected: "Pacific"},
+  // CF_HTML with no context specified (StartHTML and EndHTML set to -1)
+  {fileName: "cfhtml-nocontext.txt", expected: "3.1415926535897932"},
 ];
 var gTestIndex = 0;
 
 SimpleTest.waitForExplicitFinish();
 
 for (var i = 0; i < gTests.length; ++i) {
   gTests[i].data = loadCF_HTMLdata("data/" + gTests[i].fileName);
 }