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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 protected: | 42 protected: |
43 virtual void SetUp() | 43 virtual void SetUp() |
44 { | 44 { |
45 pageHolder = DummyPageHolder::create(); | 45 pageHolder = DummyPageHolder::create(); |
46 document = &pageHolder->document(); | 46 document = &pageHolder->document(); |
47 } | 47 } |
48 | 48 |
49 virtual void TearDown() | 49 virtual void TearDown() |
50 { | 50 { |
51 document.release(); | 51 document.release(); |
52 ThreadState::current()-> collectAllGarbage(); | 52 ThreadHeap::collectAllGarbage(); |
53 } | 53 } |
54 | 54 |
55 std::unique_ptr<DummyPageHolder> pageHolder; | 55 std::unique_ptr<DummyPageHolder> pageHolder; |
56 Persistent<Document> document; | 56 Persistent<Document> document; |
57 Persistent<DocumentTimeline> timeline; | 57 Persistent<DocumentTimeline> timeline; |
58 Timing timing; | 58 Timing timing; |
59 }; | 59 }; |
60 | 60 |
61 TEST_F(AnimationDocumentTimelineTest, PlayAfterDocumentDeref) | 61 TEST_F(AnimationDocumentTimelineTest, PlayAfterDocumentDeref) |
62 { | 62 { |
63 timing.iterationDuration = 2; | 63 timing.iterationDuration = 2; |
64 timing.startDelay = 5; | 64 timing.startDelay = 5; |
65 | 65 |
66 timeline = &document->timeline(); | 66 timeline = &document->timeline(); |
67 document = nullptr; | 67 document = nullptr; |
68 | 68 |
69 KeyframeEffect* keyframeEffect = KeyframeEffect::create(0, nullptr, timing); | 69 KeyframeEffect* keyframeEffect = KeyframeEffect::create(0, nullptr, timing); |
70 // Test passes if this does not crash. | 70 // Test passes if this does not crash. |
71 timeline->play(keyframeEffect); | 71 timeline->play(keyframeEffect); |
72 } | 72 } |
73 | 73 |
74 } // namespace blink | 74 } // namespace blink |
OLD | NEW |