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

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: 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..1bded023019b6b04561d7f58e078d6f59a275b45 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();
jochen (gone - plz use gerrit) 2014/07/17 14:17:24 why this change?
wibling-chromium 2014/07/17 14:18:51 Because I am doing a GC with no pointers on stack
WebCore::Element* div = document->getElementById("div");
WebCore::EventHandlerRegistry& registry = document->frameHost()->eventHandlerRegistry();
@@ -1818,6 +1818,11 @@ 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.
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
haraken 2014/07/17 14:32:28 We prefer using Heap::collectAllGarbage() in tests
wibling-chromium 2014/07/17 14:37:53 Done.
+#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