| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 std::unique_ptr<scheduler::FakeWebTaskRunner> m_runner; | 98 std::unique_ptr<scheduler::FakeWebTaskRunner> m_runner; |
| 99 bool m_complete; | 99 bool m_complete; |
| 100 long long m_transferSize; | 100 long long m_transferSize; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 class ResourceFetcherTest : public ::testing::Test { | 103 class ResourceFetcherTest : public ::testing::Test { |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 class TestResourceFactory : public ResourceFactory { | 106 class TestResourceFactory : public ResourceFactory { |
| 107 public: | 107 public: |
| 108 TestResourceFactory(Resource::Type type = Resource::Raw) | 108 explicit TestResourceFactory(Resource::Type type = Resource::Raw) |
| 109 : ResourceFactory(type) { } | 109 : ResourceFactory(type) { } |
| 110 | 110 |
| 111 Resource* create(const ResourceRequest& request, const ResourceLoaderOptions
& options, const String& charset) const override | 111 Resource* create(const ResourceRequest& request, const ResourceLoaderOptions
& options, const String& charset) const override |
| 112 { | 112 { |
| 113 return Resource::create(request, type(), options); | 113 return Resource::create(request, type(), options); |
| 114 } | 114 } |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 TEST_F(ResourceFetcherTest, StartLoadAfterFrameDetach) | 117 TEST_F(ResourceFetcherTest, StartLoadAfterFrameDetach) |
| 118 { | 118 { |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 FetchRequest fetchRequest = FetchRequest(url, FetchInitiatorInfo()); | 677 FetchRequest fetchRequest = FetchRequest(url, FetchInitiatorInfo()); |
| 678 Platform::current()->getURLLoaderMockFactory()->registerURL(url, WebURLRespo
nse(), ""); | 678 Platform::current()->getURLLoaderMockFactory()->registerURL(url, WebURLRespo
nse(), ""); |
| 679 Resource* newResource = fetcher->requestResource(fetchRequest, TestResourceF
actory(Resource::Raw)); | 679 Resource* newResource = fetcher->requestResource(fetchRequest, TestResourceF
actory(Resource::Raw)); |
| 680 fetcher->stopFetching(); | 680 fetcher->stopFetching(); |
| 681 Platform::current()->getURLLoaderMockFactory()->unregisterURL(url); | 681 Platform::current()->getURLLoaderMockFactory()->unregisterURL(url); |
| 682 | 682 |
| 683 EXPECT_NE(resource, newResource); | 683 EXPECT_NE(resource, newResource); |
| 684 } | 684 } |
| 685 | 685 |
| 686 } // namespace blink | 686 } // namespace blink |
| OLD | NEW |