| 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 e44a000797ed81a2a40f48445e7124e61c2db6dc..ab4db93540a5144ace4318059251d27e5381283a 100644
|
| --- a/content/child/web_url_loader_impl_unittest.cc
|
| +++ b/content/child/web_url_loader_impl_unittest.cc
|
| @@ -507,7 +507,7 @@ TEST_F(WebURLLoaderImplTest, DataURLDeleteOnReceiveData) {
|
| EXPECT_FALSE(bridge());
|
| }
|
|
|
| -TEST_F(WebURLLoaderImplTest, DataURLDeleteOnFinisha) {
|
| +TEST_F(WebURLLoaderImplTest, DataURLDeleteOnFinish) {
|
| blink::WebURLRequest request;
|
| request.initialize();
|
| request.setURL(GURL("data:text/html;charset=utf-8,blah!"));
|
| @@ -520,6 +520,44 @@ TEST_F(WebURLLoaderImplTest, DataURLDeleteOnFinisha) {
|
| EXPECT_FALSE(bridge());
|
| }
|
|
|
| +TEST_F(WebURLLoaderImplTest, DataURLDefersLoading) {
|
| + blink::WebURLRequest request;
|
| + request.initialize();
|
| + request.setURL(GURL("data:text/html;charset=utf-8,blah!"));
|
| + client()->loader()->loadAsynchronously(request, client());
|
| +
|
| + // Calling setDefersLoading() with true and then false might not be paired.
|
| + // Besides, the user of the API will not have sufficient about the
|
| + // WebURLLoader's internal state, so the latter gracefully needs to handle
|
| + // calling setDefersLoading any number of times with any values from any point
|
| + // in time.
|
| +
|
| + client()->loader()->setDefersLoading(false);
|
| + client()->loader()->setDefersLoading(true);
|
| + client()->loader()->setDefersLoading(true);
|
| + message_loop()->RunUntilIdle();
|
| + EXPECT_FALSE(client()->did_finish());
|
| +
|
| + client()->loader()->setDefersLoading(false);
|
| + client()->loader()->setDefersLoading(true);
|
| + message_loop()->RunUntilIdle();
|
| + EXPECT_FALSE(client()->did_finish());
|
| +
|
| + client()->loader()->setDefersLoading(false);
|
| + message_loop()->RunUntilIdle();
|
| + EXPECT_TRUE(client()->did_finish());
|
| +
|
| + client()->loader()->setDefersLoading(true);
|
| + client()->loader()->setDefersLoading(false);
|
| + client()->loader()->setDefersLoading(false);
|
| + message_loop()->RunUntilIdle();
|
| + EXPECT_TRUE(client()->did_finish());
|
| +
|
| + EXPECT_EQ("blah!", client()->received_data());
|
| + EXPECT_EQ(net::OK, client()->error().reason);
|
| + EXPECT_EQ("", client()->error().domain.utf8());
|
| +}
|
| +
|
| // FTP integration tests. These are focused more on safe deletion than correct
|
| // parsing of FTP responses.
|
|
|
|
|