Index: content/child/web_url_loader_impl_unittest.cc |
diff --git a/content/child/web_url_loader_impl_unittest.cc b/content/child/web_url_loader_impl_unittest.cc |
index 81b6779bcb6d77298d0034ae352c28eacb3b9167..1a752d7d4ffadbcc171ae3d24c289d7e84de0506 100644 |
--- a/content/child/web_url_loader_impl_unittest.cc |
+++ b/content/child/web_url_loader_impl_unittest.cc |
@@ -7,8 +7,10 @@ |
#include <string.h> |
#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
#include "base/memory/weak_ptr.h" |
#include "base/message_loop/message_loop.h" |
+#include "base/time/time.h" |
#include "content/child/resource_dispatcher.h" |
#include "content/public/child/request_peer.h" |
#include "content/public/common/resource_response_info.h" |
@@ -52,6 +54,27 @@ const char kMultipartResponse[] = |
"Content-type: text/html\n\n" |
"ah!"; |
+TEST(GetInfoFromDataURLTest, Simple) { |
darin (slow to review)
2014/08/18 20:23:58
I think the unit testing in src/net/ is sufficient
tyoshino (SeeGerritForStatus)
2014/08/19 13:44:56
OK. Removed.
|
+ ResourceResponseInfo info; |
+ std::string data; |
+ |
+ ASSERT_EQ(net::OK, |
+ GetInfoFromDataURL(GURL("data:,Hello"), &info, &data)); |
+ |
+ EXPECT_FALSE(info.load_timing.request_start.is_null()); |
+ EXPECT_FALSE(info.load_timing.request_start_time.is_null()); |
+ EXPECT_FALSE(info.request_time.is_null()); |
+ EXPECT_FALSE(info.response_time.is_null()); |
+ EXPECT_TRUE(info.headers.get()); |
+ EXPECT_EQ("text/plain", info.mime_type); |
+ EXPECT_EQ("US-ASCII", info.charset); |
+ EXPECT_TRUE(info.security_info.empty()); |
+ EXPECT_EQ(5, info.content_length); |
+ EXPECT_EQ(0, info.encoded_data_length); |
+ |
+ EXPECT_EQ("Hello", data); |
+} |
+ |
class TestBridge : public webkit_glue::ResourceLoaderBridge, |
public base::SupportsWeakPtr<TestBridge> { |
public: |