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

Unified Diff: mojo/converters/url/url_type_converters_unittest.cc

Issue 1841863002: Update monet. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/converters/url/url_type_converters.cc ('k') | mojo/data_pipe_utils/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/converters/url/url_type_converters_unittest.cc
diff --git a/mojo/converters/url/url_type_converters_unittest.cc b/mojo/converters/url/url_type_converters_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bc9407423dd6674242eccee52e6a78f27ce3b52e
--- /dev/null
+++ b/mojo/converters/url/url_type_converters_unittest.cc
@@ -0,0 +1,31 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/converters/url/url_type_converters.h"
+
+#include "mojo/public/cpp/bindings/string.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+namespace mojo {
+namespace {
+
+TEST(UrlTypeConvertersTest, URL) {
+ GURL url("mojo:foo");
+ String mojo_string(String::From(url));
+
+ ASSERT_EQ(url.spec(), mojo_string);
+ EXPECT_EQ(url.spec(), mojo_string.To<GURL>().spec());
+ EXPECT_EQ(url.spec(), String::From(url));
+
+ GURL invalid = String().To<GURL>();
+ ASSERT_TRUE(invalid.spec().empty());
+
+ String string_from_invalid = String::From(invalid);
+ EXPECT_FALSE(string_from_invalid.is_null());
+ ASSERT_EQ(0U, string_from_invalid.size());
+}
+
+} // namespace
+} // namespace mojo
« no previous file with comments | « mojo/converters/url/url_type_converters.cc ('k') | mojo/data_pipe_utils/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698