Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: webkit/glue/dom_serializer_unittest.cc

Issue 2878030: SerializerTests.SerializeHTMLDOMWithNonStandardEntities (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/hash_tables.h" 8 #include "base/hash_tables.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "net/base/net_util.h" 10 #include "net/base/net_util.h"
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 WebFrame* web_frame = FindSubFrameByURL(test_shell_->webView(), file_url); 643 WebFrame* web_frame = FindSubFrameByURL(test_shell_->webView(), file_url);
644 WebDocument doc = web_frame->document(); 644 WebDocument doc = web_frame->document();
645 ASSERT_TRUE(doc.isHTMLDocument()); 645 ASSERT_TRUE(doc.isHTMLDocument());
646 WebElement body_element = doc.body(); 646 WebElement body_element = doc.body();
647 // Unescaped string for "%⊅&supl;'". 647 // Unescaped string for "%⊅&supl;'".
648 static const wchar_t parsed_value[] = { 648 static const wchar_t parsed_value[] = {
649 '%', 0x2285, 0x00b9, '\'', 0 649 '%', 0x2285, 0x00b9, '\'', 0
650 }; 650 };
651 WebString value = body_element.getAttribute("title"); 651 WebString value = body_element.getAttribute("title");
652 ASSERT_TRUE(UTF16ToWide(value) == parsed_value); 652 ASSERT_TRUE(UTF16ToWide(value) == parsed_value);
653 // Check the BODY content. 653 ASSERT_TRUE(UTF16ToWide(body_element.innerText()) == parsed_value);
654 WebNode text_node = body_element.firstChild();
655 ASSERT_TRUE(text_node.isTextNode());
656 ASSERT_TRUE(UTF16ToWide(text_node.nodeValue()) == parsed_value);
657 654
658 // Do serialization. 655 // Do serialization.
659 SerializeDomForURL(file_url, false); 656 SerializeDomForURL(file_url, false);
660 // Check the serialized string. 657 // Check the serialized string.
661 ASSERT_TRUE(HasSerializedFrame(file_url)); 658 ASSERT_TRUE(HasSerializedFrame(file_url));
662 const std::string& serialized_contents = 659 const std::string& serialized_contents =
663 GetSerializedContentForFrame(file_url); 660 GetSerializedContentForFrame(file_url);
664 // Confirm that the serialized string has no non-standard HTML entities. 661 // Confirm that the serialized string has no non-standard HTML entities.
665 ASSERT_EQ(std::string::npos, serialized_contents.find("%")); 662 ASSERT_EQ(std::string::npos, serialized_contents.find("%"));
666 ASSERT_EQ(std::string::npos, serialized_contents.find("⊅")); 663 ASSERT_EQ(std::string::npos, serialized_contents.find("⊅"));
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 page_file_path = page_file_path.AppendASCII("iframe-src-is-exe.htm"); 841 page_file_path = page_file_path.AppendASCII("iframe-src-is-exe.htm");
845 GURL file_url = net::FilePathToFileURL(page_file_path); 842 GURL file_url = net::FilePathToFileURL(page_file_path);
846 ASSERT_TRUE(file_url.SchemeIsFile()); 843 ASSERT_TRUE(file_url.SchemeIsFile());
847 // Load the test file. 844 // Load the test file.
848 LoadPageFromURL(file_url); 845 LoadPageFromURL(file_url);
849 // Do a recursive serialization. We pass if we don't crash. 846 // Do a recursive serialization. We pass if we don't crash.
850 SerializeDomForURL(file_url, true); 847 SerializeDomForURL(file_url, true);
851 } 848 }
852 849
853 } // namespace 850 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698