OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/invalidation/InvalidationSet.h" | 5 #include "core/css/invalidation/InvalidationSet.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 set1->addId("a"); | 34 set1->addId("a"); |
35 set2->setWholeSubtreeInvalid(); | 35 set2->setWholeSubtreeInvalid(); |
36 | 36 |
37 set1->combine(*set2); | 37 set1->combine(*set2); |
38 | 38 |
39 ASSERT_TRUE(set1->wholeSubtreeInvalid()); | 39 ASSERT_TRUE(set1->wholeSubtreeInvalid()); |
40 ASSERT_TRUE(set1->isEmpty()); | 40 ASSERT_TRUE(set1->isEmpty()); |
41 } | 41 } |
42 | 42 |
43 // No need to add HashSets from combining set when we already have wholeSubtreeI
nvalid. | 43 // No need to add HashSets from combining set when we already have |
| 44 // wholeSubtreeInvalid. |
44 TEST(InvalidationSetTest, SubtreeInvalid_Combine_2) { | 45 TEST(InvalidationSetTest, SubtreeInvalid_Combine_2) { |
45 RefPtr<DescendantInvalidationSet> set1 = DescendantInvalidationSet::create(); | 46 RefPtr<DescendantInvalidationSet> set1 = DescendantInvalidationSet::create(); |
46 RefPtr<DescendantInvalidationSet> set2 = DescendantInvalidationSet::create(); | 47 RefPtr<DescendantInvalidationSet> set2 = DescendantInvalidationSet::create(); |
47 | 48 |
48 set1->setWholeSubtreeInvalid(); | 49 set1->setWholeSubtreeInvalid(); |
49 set2->addAttribute("a"); | 50 set2->addAttribute("a"); |
50 | 51 |
51 set1->combine(*set2); | 52 set1->combine(*set2); |
52 | 53 |
53 ASSERT_TRUE(set1->wholeSubtreeInvalid()); | 54 ASSERT_TRUE(set1->wholeSubtreeInvalid()); |
(...skipping 10 matching lines...) Expand all Loading... |
64 } | 65 } |
65 | 66 |
66 #ifndef NDEBUG | 67 #ifndef NDEBUG |
67 TEST(InvalidationSetTest, ShowDebug) { | 68 TEST(InvalidationSetTest, ShowDebug) { |
68 RefPtr<InvalidationSet> set = DescendantInvalidationSet::create(); | 69 RefPtr<InvalidationSet> set = DescendantInvalidationSet::create(); |
69 set->show(); | 70 set->show(); |
70 } | 71 } |
71 #endif // NDEBUG | 72 #endif // NDEBUG |
72 | 73 |
73 } // namespace blink | 74 } // namespace blink |
OLD | NEW |