OLD | NEW |
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 33 matching lines...) Loading... |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 class ResourceFetcherTest : public ::testing::Test { | 46 class ResourceFetcherTest : public ::testing::Test { |
47 }; | 47 }; |
48 | 48 |
49 TEST_F(ResourceFetcherTest, StartLoadAfterFrameDetach) | 49 TEST_F(ResourceFetcherTest, StartLoadAfterFrameDetach) |
50 { | 50 { |
51 KURL secureURL(ParsedURLString, "https://secureorigin.test/image.png"); | 51 KURL secureURL(ParsedURLString, "https://secureorigin.test/image.png"); |
52 // Try to request a url. The request should fail, no resource should be retu
rned, | 52 // Try to request a url. The request should fail, no resource should be retu
rned, |
53 // and no resource should be present in the cache. | 53 // and no resource should be present in the cache. |
54 RefPtrWillBeRawPtr<ResourceFetcher> fetcher = ResourceFetcher::create(FetchC
ontext::create()); | 54 RefPtrWillBeRawPtr<ResourceFetcher> fetcher = ResourceFetcher::create(nullpt
r); |
55 FetchRequest fetchRequest = FetchRequest(ResourceRequest(secureURL), FetchIn
itiatorInfo()); | 55 FetchRequest fetchRequest = FetchRequest(ResourceRequest(secureURL), FetchIn
itiatorInfo()); |
56 ResourcePtr<ImageResource> image = fetcher->fetchImage(fetchRequest); | 56 ResourcePtr<ImageResource> image = fetcher->fetchImage(fetchRequest); |
57 EXPECT_EQ(image.get(), static_cast<ImageResource*>(0)); | 57 EXPECT_EQ(image.get(), static_cast<ImageResource*>(0)); |
58 EXPECT_EQ(memoryCache()->resourceForURL(secureURL), static_cast<Resource*>(0
)); | 58 EXPECT_EQ(memoryCache()->resourceForURL(secureURL), static_cast<Resource*>(0
)); |
59 } | 59 } |
60 | 60 |
61 } // namespace blink | 61 } // namespace blink |
OLD | NEW |