summaryrefslogtreecommitdiffstats
path: root/webkit/glue/dom_serializer_unittest.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 10:17:12 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 10:17:12 +0000
commit72cbd32707a2ede460bcc1b3cb199e653282a8ed (patch)
treed212d36fbd064fd4b8c5783a9002f235c98d7a2d /webkit/glue/dom_serializer_unittest.cc
parent2fe25aac3d317086338a761e3b040cbcffc3a873 (diff)
downloadchromium_src-72cbd32707a2ede460bcc1b3cb199e653282a8ed.zip
chromium_src-72cbd32707a2ede460bcc1b3cb199e653282a8ed.tar.gz
chromium_src-72cbd32707a2ede460bcc1b3cb199e653282a8ed.tar.bz2
Switching things to FilePath:
Remove following deprecated wstring-using functions: net/net_util: FilePathToFileURL net/net_util: FileURLToFilePath Switch net/base/upload_data to FilePath. Switch upload-related parts of net/url_request/url_request to FilePath. Made necessary adjustments in rest of code (a lot). Review URL: http://codereview.chromium.org/63011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/dom_serializer_unittest.cc')
-rw-r--r--webkit/glue/dom_serializer_unittest.cc50
1 files changed, 28 insertions, 22 deletions
diff --git a/webkit/glue/dom_serializer_unittest.cc b/webkit/glue/dom_serializer_unittest.cc
index 03afe5b..34a04a8 100644
--- a/webkit/glue/dom_serializer_unittest.cc
+++ b/webkit/glue/dom_serializer_unittest.cc
@@ -238,8 +238,9 @@ bool IsMetaElement(const WebCore::Node* node, WebCore::String* charset_info) {
// If original contents have document type, the serialized contents also have
// document type.
TEST_F(DomSerializerTests, SerialzeHTMLDOMWithDocType) {
- std::wstring page_file_path = data_dir_;
- file_util::AppendToPath(&page_file_path, L"dom_serializer/youtube_1.htm");
+ FilePath page_file_path = data_dir_;
+ page_file_path = page_file_path.AppendASCII("dom_serializer");
+ page_file_path = page_file_path.AppendASCII("youtube_1.htm");
GURL file_url = net::FilePathToFileURL(page_file_path);
ASSERT_TRUE(file_url.SchemeIsFile());
// Load the test file.
@@ -269,8 +270,9 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithDocType) {
// If original contents do not have document type, the serialized contents
// also do not have document type.
TEST_F(DomSerializerTests, SerialzeHTMLDOMWithoutDocType) {
- std::wstring page_file_path = data_dir_;
- file_util::AppendToPath(&page_file_path, L"dom_serializer/youtube_2.htm");
+ FilePath page_file_path = data_dir_;
+ page_file_path = page_file_path.AppendASCII("dom_serializer");
+ page_file_path = page_file_path.AppendASCII("youtube_2.htm");
GURL file_url = net::FilePathToFileURL(page_file_path);
ASSERT_TRUE(file_url.SchemeIsFile());
// Load the test file.
@@ -301,8 +303,9 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithoutDocType) {
// finishing serialization, the serialized contents should be same
// with original XML document.
TEST_F(DomSerializerTests, SerialzeXMLDocWithBuiltInEntities) {
- std::wstring page_file_path = data_dir_;
- file_util::AppendToPath(&page_file_path, L"dom_serializer/note.xml");
+ FilePath page_file_path = data_dir_;
+ page_file_path = page_file_path.AppendASCII("dom_serializer");
+ page_file_path = page_file_path.AppendASCII("note.xml");
// Read original contents for later comparison.
std::string orginal_contents;
ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents));
@@ -322,8 +325,9 @@ TEST_F(DomSerializerTests, SerialzeXMLDocWithBuiltInEntities) {
// When serializing DOM, we add MOTW declaration before html tag.
TEST_F(DomSerializerTests, SerialzeHTMLDOMWithAddingMOTW) {
- std::wstring page_file_path = data_dir_;
- file_util::AppendToPath(&page_file_path, L"dom_serializer/youtube_2.htm");
+ FilePath page_file_path = data_dir_;
+ page_file_path = page_file_path.AppendASCII("dom_serializer");
+ page_file_path = page_file_path.AppendASCII("youtube_2.htm");
// Read original contents for later comparison .
std::string orginal_contents;
ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents));
@@ -355,8 +359,9 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithAddingMOTW) {
// http://bugs.webkit.org/show_bug.cgi?id=16621 even the original document
// does not have META charset declaration.
TEST_F(DomSerializerTests, SerialzeHTMLDOMWithNoMetaCharsetInOriginalDoc) {
- std::wstring page_file_path = data_dir_;
- file_util::AppendToPath(&page_file_path, L"dom_serializer/youtube_1.htm");
+ FilePath page_file_path = data_dir_;
+ page_file_path = page_file_path.AppendASCII("dom_serializer");
+ page_file_path = page_file_path.AppendASCII("youtube_1.htm");
// Get file URL.
GURL file_url = net::FilePathToFileURL(page_file_path);
ASSERT_TRUE(file_url.SchemeIsFile());
@@ -417,8 +422,9 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithNoMetaCharsetInOriginalDoc) {
// declarations.
TEST_F(DomSerializerTests,
SerialzeHTMLDOMWithMultipleMetaCharsetInOriginalDoc) {
- std::wstring page_file_path = data_dir_;
- file_util::AppendToPath(&page_file_path, L"dom_serializer/youtube_2.htm");
+ FilePath page_file_path = data_dir_;
+ page_file_path = page_file_path.AppendASCII("dom_serializer");
+ page_file_path = page_file_path.AppendASCII("youtube_2.htm");
// Get file URL.
GURL file_url = net::FilePathToFileURL(page_file_path);
ASSERT_TRUE(file_url.SchemeIsFile());
@@ -480,9 +486,9 @@ TEST_F(DomSerializerTests,
// Test situation of html entities in text when serializing HTML DOM.
TEST_F(DomSerializerTests, SerialzeHTMLDOMWithEntitiesInText) {
- std::wstring page_file_path = data_dir_;
- file_util::AppendToPath(&page_file_path,
- L"dom_serializer/htmlentities_in_text.htm");
+ FilePath page_file_path = data_dir_;
+ page_file_path = page_file_path.AppendASCII("dom_serializer");
+ page_file_path = page_file_path.AppendASCII("htmlentities_in_text.htm");
// Read original contents for later comparison .
std::string orginal_contents;
ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents));
@@ -520,9 +526,10 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithEntitiesInText) {
// Test situation of html entities in attribute value when serializing
// HTML DOM.
TEST_F(DomSerializerTests, SerialzeHTMLDOMWithEntitiesInAttributeValue) {
- std::wstring page_file_path = data_dir_;
- file_util::AppendToPath(&page_file_path,
- L"dom_serializer/htmlentities_in_attribute_value.htm");
+ FilePath page_file_path = data_dir_;
+ page_file_path = page_file_path.AppendASCII("dom_serializer");
+ page_file_path =
+ page_file_path.AppendASCII("htmlentities_in_attribute_value.htm");
// Read original contents for later comparison.
std::string orginal_contents;
ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents));
@@ -565,17 +572,16 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithBaseTag) {
// There are total 2 available base tags in this test file.
const int kTotalBaseTagCountInTestFile = 2;
- FilePath page_file_path = FilePath::FromWStringHack(data_dir_).AppendASCII(
- "dom_serializer");
+ FilePath page_file_path = data_dir_.AppendASCII("dom_serializer");
file_util::EnsureEndsWithSeparator(&page_file_path);
// Get page dir URL which is base URL of this file.
- GURL path_dir_url = net::FilePathToFileURL(page_file_path.ToWStringHack());
+ GURL path_dir_url = net::FilePathToFileURL(page_file_path);
// Get file path.
page_file_path =
page_file_path.AppendASCII("html_doc_has_base_tag.htm");
// Get file URL.
- GURL file_url = net::FilePathToFileURL(page_file_path.ToWStringHack());
+ GURL file_url = net::FilePathToFileURL(page_file_path);
ASSERT_TRUE(file_url.SchemeIsFile());
// Load the test file.
LoadPageFromURL(file_url);