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

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp

Issue 1644543002: Moved element style recalc count and stats to StyleEngine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/html/shadow/MediaControls.h" 5 #include "core/html/shadow/MediaControls.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/css/StylePropertySet.h" 8 #include "core/css/StylePropertySet.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/ElementTraversal.h" 10 #include "core/dom/ElementTraversal.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 ASSERT_TRUE(isElementVisible(*panel)); 116 ASSERT_TRUE(isElementVisible(*panel));
117 mediaControls().hide(); 117 mediaControls().hide();
118 ASSERT_FALSE(isElementVisible(*panel)); 118 ASSERT_FALSE(isElementVisible(*panel));
119 mediaControls().reset(); 119 mediaControls().reset();
120 ASSERT_FALSE(isElementVisible(*panel)); 120 ASSERT_FALSE(isElementVisible(*panel));
121 } 121 }
122 122
123 TEST_F(MediaControlsTest, ResetDoesNotTriggerInitialLayout) 123 TEST_F(MediaControlsTest, ResetDoesNotTriggerInitialLayout)
124 { 124 {
125 Document& document = this->document(); 125 Document& document = this->document();
126 int oldResolverCount = document.styleEngine().resolverAccessCount(); 126 int oldElementCount = document.styleEngine().styleForElementCount();
127 // Also assert that there are no layouts yet. 127 // Also assert that there are no layouts yet.
128 ASSERT_EQ(0, oldResolverCount); 128 ASSERT_EQ(0, oldElementCount);
129 mediaControls().reset(); 129 mediaControls().reset();
130 int newResolverCount = document.styleEngine().resolverAccessCount(); 130 int newElementCount = document.styleEngine().styleForElementCount();
131 ASSERT_EQ(oldResolverCount, newResolverCount); 131 ASSERT_EQ(oldElementCount, newElementCount);
132 } 132 }
133 133
134 TEST_F(MediaControlsTest, CastButtonRequiresRoute) 134 TEST_F(MediaControlsTest, CastButtonRequiresRoute)
135 { 135 {
136 mediaControls().mediaElement().setBooleanAttribute(HTMLNames::controlsAttr, true); 136 mediaControls().mediaElement().setBooleanAttribute(HTMLNames::controlsAttr, true);
137 137
138 Element* castButton = getElementByShadowPseudoId(mediaControls(), "-internal -media-controls-cast-button"); 138 Element* castButton = getElementByShadowPseudoId(mediaControls(), "-internal -media-controls-cast-button");
139 ASSERT_NE(nullptr, castButton); 139 ASSERT_NE(nullptr, castButton);
140 140
141 ASSERT_FALSE(isElementVisible(*castButton)); 141 ASSERT_FALSE(isElementVisible(*castButton));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 mediaControls().mediaElement().setBooleanAttribute(HTMLNames::disableremotep laybackAttr, true); 177 mediaControls().mediaElement().setBooleanAttribute(HTMLNames::disableremotep laybackAttr, true);
178 simulateRouteAvailabe(); 178 simulateRouteAvailabe();
179 ASSERT_FALSE(isElementVisible(*castOverlayButton)); 179 ASSERT_FALSE(isElementVisible(*castOverlayButton));
180 180
181 mediaControls().mediaElement().setBooleanAttribute(HTMLNames::disableremotep laybackAttr, false); 181 mediaControls().mediaElement().setBooleanAttribute(HTMLNames::disableremotep laybackAttr, false);
182 mediaControls().reset(); 182 mediaControls().reset();
183 ASSERT_TRUE(isElementVisible(*castOverlayButton)); 183 ASSERT_TRUE(isElementVisible(*castOverlayButton));
184 } 184 }
185 185
186 } // namespace blink 186 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | third_party/WebKit/Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698