| 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 22 matching lines...) Expand all Loading... |
| 33 #include "core/fetch/FetchContext.h" | 33 #include "core/fetch/FetchContext.h" |
| 34 #include "core/fetch/ImageResource.h" | 34 #include "core/fetch/ImageResource.h" |
| 35 #include "core/fetch/MemoryCache.h" | 35 #include "core/fetch/MemoryCache.h" |
| 36 #include "core/fetch/Resource.h" | 36 #include "core/fetch/Resource.h" |
| 37 #include "core/fetch/ResourceFetcher.h" | 37 #include "core/fetch/ResourceFetcher.h" |
| 38 #include "core/fetch/ResourcePtr.h" | 38 #include "core/fetch/ResourcePtr.h" |
| 39 #include "platform/network/ResourceRequest.h" | 39 #include "platform/network/ResourceRequest.h" |
| 40 #include "public/platform/Platform.h" | 40 #include "public/platform/Platform.h" |
| 41 #include "wtf/OwnPtr.h" | 41 #include "wtf/OwnPtr.h" |
| 42 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
| 43 | |
| 44 #include <gtest/gtest.h> | 43 #include <gtest/gtest.h> |
| 45 | 44 |
| 46 using namespace blink; | 45 namespace blink { |
| 47 | |
| 48 namespace { | |
| 49 | 46 |
| 50 // An URL for the original request. | 47 // An URL for the original request. |
| 51 const char kResourceURL[] = "http://resource.com/"; | 48 const char kResourceURL[] = "http://resource.com/"; |
| 52 | 49 |
| 53 // The origin time of our first request. | 50 // The origin time of our first request. |
| 54 const char kOriginalRequestDateAsString[] = "Thu, 25 May 1977 18:30:00 GMT"; | 51 const char kOriginalRequestDateAsString[] = "Thu, 25 May 1977 18:30:00 GMT"; |
| 55 const double kOriginalRequestDateAsDouble = 233433000.; | 52 const double kOriginalRequestDateAsDouble = 233433000.; |
| 56 | 53 |
| 57 const char kOneDayBeforeOriginalRequest[] = "Wed, 24 May 1977 18:30:00 GMT"; | 54 const char kOneDayBeforeOriginalRequest[] = "Wed, 24 May 1977 18:30:00 GMT"; |
| 58 const char kOneDayAfterOriginalRequest[] = "Fri, 26 May 1977 18:30:00 GMT"; | 55 const char kOneDayAfterOriginalRequest[] = "Fri, 26 May 1977 18:30:00 GMT"; |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 | 572 |
| 576 firstResource->setResponse(fresh200Response); | 573 firstResource->setResponse(fresh200Response); |
| 577 memoryCache()->add(firstResource.get()); | 574 memoryCache()->add(firstResource.get()); |
| 578 | 575 |
| 579 advanceClock(500.); | 576 advanceClock(500.); |
| 580 | 577 |
| 581 ResourcePtr<Resource> fetched = fetch(); | 578 ResourcePtr<Resource> fetched = fetch(); |
| 582 EXPECT_EQ(firstResource, fetched); | 579 EXPECT_EQ(firstResource, fetched); |
| 583 } | 580 } |
| 584 | 581 |
| 585 } // namespace | 582 } // namespace blink |
| OLD | NEW |