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

Unified Diff: url/gurl_unittest.cc

Issue 2469133002: Clean up URL test string conversions. (Closed)
Patch Set: More Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | url/url_canon_icu_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/gurl_unittest.cc
diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc
index d20256a712e87bf7fca48a4a6ca647a38685eec2..f8d4c05288aef540a35766f3e36c0b9eca76433c 100644
--- a/url/gurl_unittest.cc
+++ b/url/gurl_unittest.cc
@@ -5,6 +5,7 @@
#include <stddef.h>
#include "base/macros.h"
+#include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/url_canon.h"
@@ -12,9 +13,6 @@
namespace url {
-using test_utils::WStringToUTF16;
-using test_utils::ConvertUTF8ToUTF16;
-
namespace {
template<typename CHAR>
@@ -67,11 +65,11 @@ TEST(GURLTest, Types) {
// the parser is already tested and works, so we are mostly interested if the
// object does the right thing with the results.
TEST(GURLTest, Components) {
- GURL empty_url(WStringToUTF16(L""));
+ GURL empty_url(base::UTF8ToUTF16(""));
EXPECT_TRUE(empty_url.is_empty());
EXPECT_FALSE(empty_url.is_valid());
- GURL url(WStringToUTF16(L"http://user:pass@google.com:99/foo;bar?q=a#ref"));
+ GURL url(base::UTF8ToUTF16("http://user:pass@google.com:99/foo;bar?q=a#ref"));
EXPECT_FALSE(url.is_empty());
EXPECT_TRUE(url.is_valid());
EXPECT_TRUE(url.SchemeIs("http"));
@@ -116,7 +114,8 @@ TEST(GURLTest, Empty) {
}
TEST(GURLTest, Copy) {
- GURL url(WStringToUTF16(L"http://user:pass@google.com:99/foo;bar?q=a#ref"));
+ GURL url(base::UTF8ToUTF16(
+ "http://user:pass@google.com:99/foo;bar?q=a#ref"));
GURL url2(url);
EXPECT_TRUE(url2.is_valid());
@@ -149,7 +148,8 @@ TEST(GURLTest, Copy) {
}
TEST(GURLTest, Assign) {
- GURL url(WStringToUTF16(L"http://user:pass@google.com:99/foo;bar?q=a#ref"));
+ GURL url(base::UTF8ToUTF16(
+ "http://user:pass@google.com:99/foo;bar?q=a#ref"));
GURL url2;
url2 = url;
@@ -191,7 +191,8 @@ TEST(GURLTest, SelfAssign) {
}
TEST(GURLTest, CopyFileSystem) {
- GURL url(WStringToUTF16(L"filesystem:https://user:pass@google.com:99/t/foo;bar?q=a#ref"));
+ GURL url(base::UTF8ToUTF16(
+ "filesystem:https://user:pass@google.com:99/t/foo;bar?q=a#ref"));
GURL url2(url);
EXPECT_TRUE(url2.is_valid());
@@ -313,9 +314,9 @@ TEST(GURLTest, Resolve) {
EXPECT_EQ(output.SchemeIsFileSystem(), output.inner_url() != NULL);
// Wide code path.
- GURL inputw(ConvertUTF8ToUTF16(resolve_cases[i].base));
+ GURL inputw(base::UTF8ToUTF16(resolve_cases[i].base));
GURL outputw =
- input.Resolve(ConvertUTF8ToUTF16(resolve_cases[i].relative));
+ input.Resolve(base::UTF8ToUTF16(resolve_cases[i].relative));
EXPECT_EQ(resolve_cases[i].expected_valid, outputw.is_valid()) << i;
EXPECT_EQ(resolve_cases[i].expected, outputw.spec()) << i;
EXPECT_EQ(outputw.SchemeIsFileSystem(), outputw.inner_url() != NULL);
« no previous file with comments | « no previous file | url/url_canon_icu_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698