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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "core/fetch/FetchContext.h" | 31 #include "core/fetch/FetchContext.h" |
32 #include "core/fetch/ImageResource.h" | 32 #include "core/fetch/ImageResource.h" |
33 #include "core/fetch/MemoryCache.h" | 33 #include "core/fetch/MemoryCache.h" |
34 #include "core/fetch/RawResource.h" | 34 #include "core/fetch/RawResource.h" |
35 #include "core/fetch/Resource.h" | 35 #include "core/fetch/Resource.h" |
36 #include "core/fetch/ResourceFetcher.h" | 36 #include "core/fetch/ResourceFetcher.h" |
37 #include "platform/network/ResourceRequest.h" | 37 #include "platform/network/ResourceRequest.h" |
38 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
| 39 #include "wtf/OwnPtr.h" |
39 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 | 43 |
43 // An URL for the original request. | 44 // An URL for the original request. |
44 const char kResourceURL[] = "http://resource.com/"; | 45 const char kResourceURL[] = "http://resource.com/"; |
45 | 46 |
46 // The origin time of our first request. | 47 // The origin time of our first request. |
47 const char kOriginalRequestDateAsString[] = "Thu, 25 May 1977 18:30:00 GMT"; | 48 const char kOriginalRequestDateAsString[] = "Thu, 25 May 1977 18:30:00 GMT"; |
48 const double kOriginalRequestDateAsDouble = 233433000.; | 49 const double kOriginalRequestDateAsDouble = 233433000.; |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 firstResource->finish(); | 562 firstResource->finish(); |
562 memoryCache()->add(firstResource); | 563 memoryCache()->add(firstResource); |
563 | 564 |
564 advanceClock(500.); | 565 advanceClock(500.); |
565 | 566 |
566 Resource* fetched = fetch(); | 567 Resource* fetched = fetch(); |
567 EXPECT_EQ(firstResource, fetched); | 568 EXPECT_EQ(firstResource, fetched); |
568 } | 569 } |
569 | 570 |
570 } // namespace blink | 571 } // namespace blink |
OLD | NEW |