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

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp

Issue 2766583002: Set the same headers for data URLs in WebURLLoaderImpl and ResourceFetcher (Closed)
Patch Set: reflect comments Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 654
655 // Resource created by parser on the second fetcher 655 // Resource created by parser on the second fetcher
656 FetchRequest fetchRequest2 = FetchRequest(url, FetchInitiatorInfo()); 656 FetchRequest fetchRequest2 = FetchRequest(url, FetchInitiatorInfo());
657 Resource* newResource2 = MockResource::fetch(fetchRequest2, fetcher2); 657 Resource* newResource2 = MockResource::fetch(fetchRequest2, fetcher2);
658 Persistent<MockResourceClient> client2 = new MockResourceClient(newResource2); 658 Persistent<MockResourceClient> client2 = new MockResourceClient(newResource2);
659 EXPECT_NE(resource, newResource2); 659 EXPECT_NE(resource, newResource2);
660 EXPECT_FALSE(fetcher2->isFetching()); 660 EXPECT_FALSE(fetcher2->isFetching());
661 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); 661 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests();
662 } 662 }
663 663
664 TEST_F(ResourceFetcherTest, ContentTypeDataURL) {
665 ResourceFetcher* fetcher = ResourceFetcher::create(context());
666 FetchRequest fetchRequest =
667 FetchRequest(KURL(ParsedURLString, "data:text/testmimetype,foo"),
668 FetchInitiatorInfo());
669 Resource* resource = MockResource::fetch(fetchRequest, fetcher);
670 ASSERT_TRUE(resource);
671 EXPECT_EQ(ResourceStatus::Cached, resource->getStatus());
672 EXPECT_EQ("text/testmimetype", resource->response().mimeType());
673 EXPECT_EQ("text/testmimetype", resource->response().httpContentType());
674 }
675
664 } // namespace blink 676 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp ('k') | third_party/WebKit/Source/platform/network/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698