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

Unified Diff: Source/web/tests/WebFrameTest.cpp

Issue 145133006: Remove the recalc style timer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moar raf Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/tests/ScrollingCoordinatorChromiumTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index e65f1aa1c394500bbb2e49d9f8071ee788a30c46..089010b610d36898ba900b0c9783c86ba3bd0ef6 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -394,6 +394,7 @@ protected:
void executeScript(const WebString& code)
{
m_frame->executeScript(WebScriptSource(code));
+ m_frame->view()->layout();
runPendingTasks();
}
@@ -417,6 +418,7 @@ TEST_F(WebFrameCSSCallbackTest, AuthorStyleSheet)
std::vector<WebString> selectors;
selectors.push_back(WebString::fromUTF8("div.initial_on"));
m_frame->document().watchCSSSelectors(WebVector<WebString>(selectors));
+ m_frame->view()->layout();
runPendingTasks();
EXPECT_EQ(1, updateCount());
EXPECT_THAT(matchedSelectors(), testing::ElementsAre("div.initial_on"));
@@ -424,12 +426,14 @@ TEST_F(WebFrameCSSCallbackTest, AuthorStyleSheet)
// Check that adding a watched selector calls back for already-present nodes.
selectors.push_back(WebString::fromUTF8("div.initial_off"));
doc().watchCSSSelectors(WebVector<WebString>(selectors));
+ m_frame->view()->layout();
runPendingTasks();
EXPECT_EQ(2, updateCount());
EXPECT_THAT(matchedSelectors(), testing::ElementsAre("div.initial_off", "div.initial_on"));
// Check that we can turn off callbacks for certain selectors.
doc().watchCSSSelectors(WebVector<WebString>());
+ m_frame->view()->layout();
runPendingTasks();
EXPECT_EQ(3, updateCount());
EXPECT_THAT(matchedSelectors(), testing::ElementsAre());
@@ -548,6 +552,7 @@ TEST_F(WebFrameCSSCallbackTest, Reparenting)
std::vector<WebString> selectors;
selectors.push_back(WebString::fromUTF8("span"));
doc().watchCSSSelectors(WebVector<WebString>(selectors));
+ m_frame->view()->layout();
runPendingTasks();
EXPECT_EQ(1, updateCount());
@@ -571,8 +576,9 @@ TEST_F(WebFrameCSSCallbackTest, MultiSelector)
selectors.push_back(WebString::fromUTF8("span"));
selectors.push_back(WebString::fromUTF8("span,p"));
doc().watchCSSSelectors(WebVector<WebString>(selectors));
-
+ m_frame->view()->layout();
runPendingTasks();
+
EXPECT_EQ(1, updateCount());
EXPECT_THAT(matchedSelectors(), testing::ElementsAre("span", "span, p"));
}
@@ -587,8 +593,9 @@ TEST_F(WebFrameCSSCallbackTest, InvalidSelector)
selectors.push_back(WebString::fromUTF8("[")); // Invalid.
selectors.push_back(WebString::fromUTF8("p span")); // Not compound.
doc().watchCSSSelectors(WebVector<WebString>(selectors));
-
+ m_frame->view()->layout();
runPendingTasks();
+
EXPECT_EQ(1, updateCount());
EXPECT_THAT(matchedSelectors(), testing::ElementsAre("span"))
<< "An invalid selector shouldn't prevent other selectors from matching.";
« no previous file with comments | « Source/web/tests/ScrollingCoordinatorChromiumTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698