Add CFDE_TxtEdtBuf tests

This CL adds a set of unit tests for the text edit buffer. It fixes up a few
bugs found adding the tests and removes the unused ::Optimize method.

Review-Url: https://codereview.chromium.org/2614383003
diff --git a/BUILD.gn b/BUILD.gn
index 53236f5..73d0494 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1728,6 +1728,7 @@
   include_dirs = []
   if (pdf_enable_xfa) {
     sources += [
+      "xfa/fde/cfde_txtedtbuf_unittest.cpp",
       "xfa/fde/css/fde_cssdatatable_unittest.cpp",
       "xfa/fde/xml/fde_xml_imp_unittest.cpp",
       "xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp",