TEST_F(HTMLTextFormControlElementTest, WordAndSentenceBoundary)
{
    HTMLElement* innerText = textControl().innerEditorElement();
    {
        SCOPED_TRACE("String is value.");
        innerText->removeChildren();
        innerText->setNodeValue("Hel\nlo, text form.\n");
        testBoundary(document(), textControl());
    }
    {
        SCOPED_TRACE("A Text node and a BR element");
        innerText->removeChildren();
        innerText->setNodeValue("");
        innerText->appendChild(Text::create(document(), "Hello, text form."));
        innerText->appendChild(HTMLBRElement::create(document()));
        testBoundary(document(), textControl());
    }
    {
        SCOPED_TRACE("Text nodes.");
        innerText->removeChildren();
        innerText->setNodeValue("");
        innerText->appendChild(Text::create(document(), "Hel\nlo, te"));
        innerText->appendChild(Text::create(document(), "xt form."));
        testBoundary(document(), textControl());
    }
}
Example #2
0
bool LHMail::attachPart(LHMailBase* mp)
{
	setSendDataValid( FALSE );

	if (isSinglePart())
	{
		//first we need to change body into one of parts
		LHMailPart* mpb = new LHMailPart(this);
		mpb->setEncoding(encoding());
		mpb->setString(messageBody());
		addPart(mpb);
		
                header().setData("Content-Transfer-Encoding", "7bit");
		header().setData("Content-Type", "Multipart/Mixed");
		header().removeParameter("Content-Type", "charset");
		header().setParameter("Content-Type", "boundary", LHMime::getBoundaryString());
	}
	
	//check boundary
	while(0)
	{
		QString bound = header().getParameter("Content-Type", "boundary");
		if (testBoundary(bound))
		{
			break;
		}
		else
		{
			header().setParameter("Content-Type", "boundary", LHMime::getBoundaryString());
		}
	}
	
	//then add file part
	addPart(mp);
	
	return true;
}