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

Side by Side Diff: content/renderer/dom_serializer_browsertest.cc

Issue 121033002: Update uses of UTF conversions in content/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/containers/hash_tables.h" 8 #include "base/containers/hash_tables.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 // Get value of BODY's title attribute in DOM. 578 // Get value of BODY's title attribute in DOM.
579 WebFrame* web_frame = FindSubFrameByURL(GetWebView(), file_url); 579 WebFrame* web_frame = FindSubFrameByURL(GetWebView(), file_url);
580 WebDocument doc = web_frame->document(); 580 WebDocument doc = web_frame->document();
581 ASSERT_TRUE(doc.isHTMLDocument()); 581 ASSERT_TRUE(doc.isHTMLDocument());
582 WebElement body_element = doc.body(); 582 WebElement body_element = doc.body();
583 // Unescaped string for "%⊅¹'". 583 // Unescaped string for "%⊅¹'".
584 static const wchar_t parsed_value[] = { 584 static const wchar_t parsed_value[] = {
585 '%', 0x2285, 0x00b9, '\'', 0 585 '%', 0x2285, 0x00b9, '\'', 0
586 }; 586 };
587 WebString value = body_element.getAttribute("title"); 587 WebString value = body_element.getAttribute("title");
588 ASSERT_TRUE(UTF16ToWide(value) == parsed_value); 588 ASSERT_TRUE(base::UTF16ToWide(value) == parsed_value);
589 ASSERT_TRUE(UTF16ToWide(body_element.innerText()) == parsed_value); 589 ASSERT_TRUE(base::UTF16ToWide(body_element.innerText()) == parsed_value);
590 590
591 // Do serialization. 591 // Do serialization.
592 SerializeDomForURL(file_url, false); 592 SerializeDomForURL(file_url, false);
593 // Check the serialized string. 593 // Check the serialized string.
594 ASSERT_TRUE(HasSerializedFrame(file_url)); 594 ASSERT_TRUE(HasSerializedFrame(file_url));
595 const std::string& serialized_contents = 595 const std::string& serialized_contents =
596 GetSerializedContentForFrame(file_url); 596 GetSerializedContentForFrame(file_url);
597 // Confirm that the serialized string has no non-standard HTML entities. 597 // Confirm that the serialized string has no non-standard HTML entities.
598 ASSERT_EQ(std::string::npos, serialized_contents.find("%")); 598 ASSERT_EQ(std::string::npos, serialized_contents.find("%"));
599 ASSERT_EQ(std::string::npos, serialized_contents.find("⊅")); 599 ASSERT_EQ(std::string::npos, serialized_contents.find("⊅"));
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 NavigateToURL(shell(), file_url); 1023 NavigateToURL(shell(), file_url);
1024 1024
1025 PostTaskToInProcessRendererAndWait( 1025 PostTaskToInProcessRendererAndWait(
1026 base::Bind( 1026 base::Bind(
1027 &DomSerializerTests:: 1027 &DomSerializerTests::
1028 SubResourceForElementsInNonHTMLNamespaceOnRenderer, 1028 SubResourceForElementsInNonHTMLNamespaceOnRenderer,
1029 base::Unretained(this), file_url)); 1029 base::Unretained(this), file_url));
1030 } 1030 }
1031 1031
1032 } // namespace content 1032 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/devtools/devtools_client.cc ('k') | content/renderer/dom_storage/dom_storage_cached_area_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698