Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: Source/core/css/invalidation/DescendantInvalidationSetTest.cpp

Issue 946993002: Avoid style invalidation for empty sets. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added dummy selectors to tests to force descendant invalidation Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "core/css/invalidation/DescendantInvalidationSet.h" 6 #include "core/css/invalidation/DescendantInvalidationSet.h"
7 7
8 #include <gtest/gtest.h> 8 #include <gtest/gtest.h>
9 9
10 using namespace blink; 10 using namespace blink;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 set1->setWholeSubtreeInvalid(); 55 set1->setWholeSubtreeInvalid();
56 set2->addAttribute("a"); 56 set2->addAttribute("a");
57 57
58 set1->combine(*set2); 58 set1->combine(*set2);
59 59
60 ASSERT_TRUE(set1->wholeSubtreeInvalid()); 60 ASSERT_TRUE(set1->wholeSubtreeInvalid());
61 ASSERT_TRUE(set1->isEmpty()); 61 ASSERT_TRUE(set1->isEmpty());
62 } 62 }
63 63
64 TEST(DescendantInvalidationSetTest, SubtreeInvalid_AddCustomPseudoBefore)
65 {
66 RefPtrWillBeRawPtr<DescendantInvalidationSet> set = DescendantInvalidationSe t::create();
67 set->setCustomPseudoInvalid();
68 ASSERT_FALSE(set->isEmpty());
69
70 set->setWholeSubtreeInvalid();
71 ASSERT_TRUE(set->isEmpty());
72 }
73
64 #ifndef NDEBUG 74 #ifndef NDEBUG
65 TEST(DescendantInvalidationSetTest, ShowDebug) 75 TEST(DescendantInvalidationSetTest, ShowDebug)
66 { 76 {
67 RefPtrWillBeRawPtr<DescendantInvalidationSet> set = DescendantInvalidationSe t::create(); 77 RefPtrWillBeRawPtr<DescendantInvalidationSet> set = DescendantInvalidationSe t::create();
68 set->show(); 78 set->show();
69 } 79 }
70 #endif // NDEBUG 80 #endif // NDEBUG
71 81
72 } // namespace 82 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/invalidation/DescendantInvalidationSet.cpp ('k') | Source/core/css/invalidation/StyleInvalidator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698