diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-01 22:31:35 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-01 22:31:35 +0000 |
commit | de56f378336660dcc848763c80267a5e063ae47d (patch) | |
tree | 7f551b88923b35bc4022ce6ab3a3f602fb60d91c /webkit/glue/dom_serializer_unittest.cc | |
parent | dc4f63c80cb90efe594131030aad6776e5945fcc (diff) | |
download | chromium_src-de56f378336660dcc848763c80267a5e063ae47d.zip chromium_src-de56f378336660dcc848763c80267a5e063ae47d.tar.gz chromium_src-de56f378336660dcc848763c80267a5e063ae47d.tar.bz2 |
Merge the chrome_webkit_merge_branch back on to trunk. This brings us
up to webkit@36102.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/dom_serializer_unittest.cc')
-rw-r--r-- | webkit/glue/dom_serializer_unittest.cc | 21 |
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) == "&<>\"\'"); // 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); } |