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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 260 |
261 public: | 261 public: |
262 explicit RequestSameResourceOnComplete(Resource* resource) | 262 explicit RequestSameResourceOnComplete(Resource* resource) |
263 : m_resource(resource), m_notifyFinishedCalled(false) {} | 263 : m_resource(resource), m_notifyFinishedCalled(false) {} |
264 | 264 |
265 void notifyFinished(Resource* resource) override { | 265 void notifyFinished(Resource* resource) override { |
266 EXPECT_EQ(m_resource, resource); | 266 EXPECT_EQ(m_resource, resource); |
267 MockFetchContext* context = | 267 MockFetchContext* context = |
268 MockFetchContext::create(MockFetchContext::kShouldLoadNewResource); | 268 MockFetchContext::create(MockFetchContext::kShouldLoadNewResource); |
269 ResourceFetcher* fetcher2 = ResourceFetcher::create(context); | 269 ResourceFetcher* fetcher2 = ResourceFetcher::create(context); |
270 FetchRequest fetchRequest2(m_resource->url(), FetchInitiatorInfo()); | 270 ResourceRequest resourceRequest2(m_resource->url()); |
271 fetchRequest2.mutableResourceRequest().setCachePolicy( | 271 resourceRequest2.setCachePolicy(WebCachePolicy::ValidatingCacheData); |
272 WebCachePolicy::ValidatingCacheData); | 272 FetchRequest fetchRequest2(resourceRequest2, FetchInitiatorInfo()); |
273 Resource* resource2 = MockResource::fetch(fetchRequest2, fetcher2); | 273 Resource* resource2 = MockResource::fetch(fetchRequest2, fetcher2); |
274 EXPECT_EQ(m_resource, resource2); | 274 EXPECT_EQ(m_resource, resource2); |
275 m_notifyFinishedCalled = true; | 275 m_notifyFinishedCalled = true; |
276 } | 276 } |
277 bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } | 277 bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } |
278 | 278 |
279 DEFINE_INLINE_TRACE() { | 279 DEFINE_INLINE_TRACE() { |
280 visitor->trace(m_resource); | 280 visitor->trace(m_resource); |
281 RawResourceClient::trace(visitor); | 281 RawResourceClient::trace(visitor); |
282 } | 282 } |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } // namespace blink | 664 } // namespace blink |
OLD | NEW |