summaryrefslogtreecommitdiffstats
path: root/webkit/glue/dom_serializer_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue/dom_serializer_unittest.cc')
-rw-r--r--webkit/glue/dom_serializer_unittest.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/webkit/glue/dom_serializer_unittest.cc b/webkit/glue/dom_serializer_unittest.cc
index 662105e..da9d957 100644
--- a/webkit/glue/dom_serializer_unittest.cc
+++ b/webkit/glue/dom_serializer_unittest.cc
@@ -14,6 +14,7 @@
#include "HTMLMetaElement.h"
#include "HTMLNames.h"
#include "KURL.h"
+#include "markup.h"
#include "SharedBuffer.h"
#include "SubstituteData.h"
#pragma warning(pop)
@@ -111,7 +112,7 @@ class DomSerializerTests : public TestShellTest,
ASSERT_TRUE(web_frame != NULL);
int len = static_cast<int>(contents.size());
RefPtr<WebCore::SharedBuffer> buf(
- new WebCore::SharedBuffer(contents.data(), len));
+ WebCore::SharedBuffer::create(contents.data(), len));
WebCore::SubstituteData subst_data(
buf, WebCore::String("text/html"), encoding_info, WebCore::KURL());
@@ -317,7 +318,7 @@ TEST_F(DomSerializerTests, SerialzeXMLDocWithBuiltInEntities) {
ASSERT_TRUE(HasSerializedFrame(page_url));
const std::string& serialized_contents =
GetSerializedContentForFrame(page_url);
- ASSERT_EQ(serialized_contents, orginal_contents);
+ ASSERT_EQ(orginal_contents, serialized_contents);
}
// When serializing DOM, we add MOTW declaration before html tag.
@@ -506,7 +507,7 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithEntitiesInText) {
ASSERT_TRUE(body_ele != NULL);
WebCore::Node* text_node = body_ele->firstChild();
ASSERT_TRUE(text_node->isTextNode());
- ASSERT_TRUE(text_node->toString() == WebCore::String("&<>\"\'"));
+ ASSERT_TRUE(createMarkup(text_node) == "&amp;&lt;&gt;\"\'");
// Do serialization.
SerializeDomForURL(page_url, false);
// Compare the serialized contents with original contents.
@@ -518,7 +519,7 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithEntitiesInText) {
std::wstring motw_declaration =
webkit_glue::DomSerializer::GenerateMarkOfTheWebDeclaration(page_url);
orginal_contents = WideToASCII(motw_declaration) + orginal_contents;
- ASSERT_EQ(serialized_contents, orginal_contents);
+ ASSERT_EQ(orginal_contents, serialized_contents);
}
// Test situation of html entities in attribute value when serializing
@@ -606,12 +607,12 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithBaseTag) {
webkit_glue::GetSubResourceLinkFromElement(element);
if (!value && element->hasTagName(WebCore::HTMLNames::aTag)) {
value = &element->getAttribute(WebCore::HTMLNames::hrefAttr);
- if (value->domString().isEmpty())
+ if (value->isEmpty())
value = NULL;
}
// Each link is relative link.
if (value) {
- GURL link(webkit_glue::StringToStdWString(value->domString()).c_str());
+ GURL link(webkit_glue::StringToStdWString(value->string()).c_str());
ASSERT_TRUE(link.scheme().empty());
}
}
@@ -620,7 +621,7 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithBaseTag) {
// Make sure in original document, the base URL is not equal with the
// |path_dir_url|.
GURL original_base_url(
- webkit_glue::DeprecatedStringToStdWString(doc->baseURL()).c_str());
+ webkit_glue::StringToStdWString(doc->baseURL()).c_str());
ASSERT_TRUE(original_base_url != path_dir_url);
// Do serialization.
@@ -657,12 +658,12 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithBaseTag) {
webkit_glue::GetSubResourceLinkFromElement(element);
if (!value && element->hasTagName(WebCore::HTMLNames::aTag)) {
value = &element->getAttribute(WebCore::HTMLNames::hrefAttr);
- if (value->domString().isEmpty())
+ if (value->isEmpty())
value = NULL;
}
// Each link is absolute link.
if (value) {
- GURL link(webkit_glue::StringToStdWString(value->domString()).c_str());
+ GURL link(webkit_glue::StringToStdWString(value->string()).c_str());
ASSERT_FALSE(link.scheme().empty());
}
}
@@ -671,6 +672,6 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithBaseTag) {
ASSERT_TRUE(new_base_tag_count == original_base_tag_count + 1);
// Make sure in new document, the base URL is equal with the |path_dir_url|.
GURL new_base_url(
- webkit_glue::DeprecatedStringToStdWString(doc->baseURL()).c_str());
+ webkit_glue::StringToStdWString(doc->baseURL()).c_str());
ASSERT_TRUE(new_base_url == path_dir_url);
}