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

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

Issue 391373009: [oilpan]: Fix webkit unit tests for oilpan. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use collectAllGarbage Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebViewTest.cpp
diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp
index 60a64287b59825d9f426122b721fd0f98052d5b6..43957ea548f6aae5dfcb2526652f7b814810dc8d 100644
--- a/Source/web/tests/WebViewTest.cpp
+++ b/Source/web/tests/WebViewTest.cpp
@@ -1809,7 +1809,7 @@ TEST_F(WebViewTest, DeleteElementWithRegisteredHandler)
URLTestHelpers::registerMockedURLLoad(toKURL(url), "simple_div.html");
WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(url, true);
- WebCore::Document* document = webViewImpl->mainFrameImpl()->frame()->document();
+ RefPtrWillBePersistent<WebCore::Document> document = webViewImpl->mainFrameImpl()->frame()->document();
WebCore::Element* div = document->getElementById("div");
WebCore::EventHandlerRegistry& registry = document->frameHost()->eventHandlerRegistry();
@@ -1818,6 +1818,13 @@ TEST_F(WebViewTest, DeleteElementWithRegisteredHandler)
WebCore::TrackExceptionState exceptionState;
div->remove(exceptionState);
+#if ENABLE(OILPAN)
+ // For oilpan we have to force a GC to ensure the event handlers have been removed when
+ // checking below. We do a precise GC (collectAllGarbage does not scan the stack)
+ // to ensure the div element dies. This is also why the Document is in a Persistent
+ // since we want that to stay around.
+ Heap::collectAllGarbage();
+#endif
EXPECT_FALSE(registry.hasEventHandlers(WebCore::EventHandlerRegistry::ScrollEvent));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698