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 11 matching lines...) Expand all Loading... |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/animation/AnimatableStrokeDasharrayList.h" | 32 #include "core/fetch/RawResource.h" |
33 | 33 |
34 #include "core/svg/SVGLength.h" | 34 #include "core/fetch/ImageResourceClient.h" |
35 | 35 #include "core/fetch/MemoryCache.h" |
36 #include <gtest/gtest.h> | 36 #include "core/fetch/MockImageResourceClient.h" |
| 37 #include "core/fetch/ResourceFetcher.h" |
| 38 #include "core/fetch/ResourcePtr.h" |
| 39 #include "core/loader/DocumentLoader.h" |
| 40 #include "core/testing/DummyPageHolder.h" |
| 41 #include "core/testing/UnitTestHelpers.h" |
| 42 #include "platform/SharedBuffer.h" |
| 43 #include "public/platform/Platform.h" |
| 44 #include "public/platform/WebURL.h" |
| 45 #include "public/platform/WebURLResponse.h" |
| 46 #include "public/platform/WebUnitTestSupport.h" |
37 | 47 |
38 using namespace WebCore; | 48 using namespace WebCore; |
39 | 49 |
40 namespace { | 50 namespace { |
41 | 51 |
42 TEST(AnimationAnimatableStrokeDasharrayListTest, EqualTo) | 52 TEST(RawResourceTest, DontIgnoreAcceptForCacheReuse) |
43 { | 53 { |
44 Vector<SVGLength> vectorA(4); | 54 ResourceRequest jpegRequest; |
45 Vector<SVGLength> vectorB(4); | 55 jpegRequest.setHTTPAccept("image/jpeg"); |
46 RefPtr<AnimatableStrokeDasharrayList> listA = AnimatableStrokeDasharrayList:
:create(vectorA); | |
47 RefPtr<AnimatableStrokeDasharrayList> listB = AnimatableStrokeDasharrayList:
:create(vectorB); | |
48 EXPECT_TRUE(listA->equals(listB.get())); | |
49 | 56 |
50 TrackExceptionState exceptionState; | 57 RawResource jpegResource(jpegRequest, Resource::Raw); |
51 vectorB[3].newValueSpecifiedUnits(LengthTypePX, 50, exceptionState); | |
52 listB = AnimatableStrokeDasharrayList::create(vectorB); | |
53 EXPECT_FALSE(listA->equals(listB.get())); | |
54 | 58 |
55 vectorB = Vector<SVGLength>(5); | 59 ResourceRequest pngRequest; |
56 listB = AnimatableStrokeDasharrayList::create(vectorB); | 60 pngRequest.setHTTPAccept("image/png"); |
57 EXPECT_FALSE(listA->equals(listB.get())); | 61 |
| 62 ASSERT_FALSE(jpegResource.canReuse(pngRequest)); |
58 } | 63 } |
59 | 64 |
60 } // namespace | 65 } // namespace |
OLD | NEW |