OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014, Google Inc. All rights reserved. | 2 * Copyright (c) 2014, 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 const char kOneDayBeforeOriginalRequest[] = "Wed, 24 May 1977 18:30:00 GMT"; | 57 const char kOneDayBeforeOriginalRequest[] = "Wed, 24 May 1977 18:30:00 GMT"; |
58 const char kOneDayAfterOriginalRequest[] = "Fri, 26 May 1977 18:30:00 GMT"; | 58 const char kOneDayAfterOriginalRequest[] = "Fri, 26 May 1977 18:30:00 GMT"; |
59 | 59 |
60 const unsigned char kAConstUnsignedCharZero = 0; | 60 const unsigned char kAConstUnsignedCharZero = 0; |
61 | 61 |
62 class MockFetchContext : public FetchContext { | 62 class MockFetchContext : public FetchContext { |
63 public: | 63 public: |
64 static PassOwnPtrWillBeRawPtr<MockFetchContext> create() | 64 static PassOwnPtrWillBeRawPtr<MockFetchContext> create() |
65 { | 65 { |
66 return adoptPtr(new MockFetchContext); | 66 return adoptPtrWillBeNoop(new MockFetchContext); |
67 } | 67 } |
68 | 68 |
69 ~MockFetchContext() { } | 69 ~MockFetchContext() { } |
70 | 70 |
71 bool allowImage(bool imagesEnabled, const KURL&) const override { return tru
e; } | 71 bool allowImage(bool imagesEnabled, const KURL&) const override { return tru
e; } |
72 bool canRequest(Resource::Type, const ResourceRequest&, const KURL&, const R
esourceLoaderOptions&, bool forPreload, FetchRequest::OriginRestriction) const o
verride { return true; } | 72 bool canRequest(Resource::Type, const ResourceRequest&, const KURL&, const R
esourceLoaderOptions&, bool forPreload, FetchRequest::OriginRestriction) const o
verride { return true; } |
73 | 73 |
74 private: | 74 private: |
75 MockFetchContext() { } | 75 MockFetchContext() { } |
76 }; | 76 }; |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 firstResource->setResponse(fresh200Response); | 569 firstResource->setResponse(fresh200Response); |
570 memoryCache()->add(firstResource.get()); | 570 memoryCache()->add(firstResource.get()); |
571 | 571 |
572 advanceClock(500.); | 572 advanceClock(500.); |
573 | 573 |
574 ResourcePtr<Resource> fetched = fetch(); | 574 ResourcePtr<Resource> fetched = fetch(); |
575 EXPECT_EQ(firstResource, fetched); | 575 EXPECT_EQ(firstResource, fetched); |
576 } | 576 } |
577 | 577 |
578 } // namespace | 578 } // namespace |
OLD | NEW |