| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 { | 55 { |
| 56 return new Resource(request, Resource::Image); | 56 return new Resource(request, Resource::Image); |
| 57 } | 57 } |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 TEST_F(ResourceFetcherTest, StartLoadAfterFrameDetach) | 60 TEST_F(ResourceFetcherTest, StartLoadAfterFrameDetach) |
| 61 { | 61 { |
| 62 KURL secureURL(ParsedURLString, "https://secureorigin.test/image.png"); | 62 KURL secureURL(ParsedURLString, "https://secureorigin.test/image.png"); |
| 63 // Try to request a url. The request should fail, no resource should be retu
rned, | 63 // Try to request a url. The request should fail, no resource should be retu
rned, |
| 64 // and no resource should be present in the cache. | 64 // and no resource should be present in the cache. |
| 65 RefPtrWillBeRawPtr<ResourceFetcher> fetcher = ResourceFetcher::create(nullpt
r); | 65 ResourceFetcher* fetcher = ResourceFetcher::create(FetchContext::create()); |
| 66 FetchRequest fetchRequest = FetchRequest(ResourceRequest(secureURL), FetchIn
itiatorInfo()); | 66 FetchRequest fetchRequest = FetchRequest(ResourceRequest(secureURL), FetchIn
itiatorInfo()); |
| 67 ResourcePtr<Resource> resource = fetcher->requestResource(fetchRequest, Test
ResourceFactory()); | 67 ResourcePtr<Resource> resource = fetcher->requestResource(fetchRequest, Test
ResourceFactory()); |
| 68 EXPECT_EQ(resource.get(), static_cast<Resource*>(nullptr)); | 68 EXPECT_EQ(resource.get(), static_cast<Resource*>(nullptr)); |
| 69 EXPECT_EQ(memoryCache()->resourceForURL(secureURL), static_cast<Resource*>(n
ullptr)); | 69 EXPECT_EQ(memoryCache()->resourceForURL(secureURL), static_cast<Resource*>(n
ullptr)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace blink | 72 } // namespace blink |
| OLD | NEW |