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

Unified Diff: content/renderer/render_view_browsertest.cc

Issue 1621823004: Insist on a Blink GC on RenderViewImpl unit test teardowns. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_browsertest.cc
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc
index 8c98001097f0fe4f63a7dd455a90d75f89ba046c..868be6fa4836a755b62721625000590bc6a90d60 100644
--- a/content/renderer/render_view_browsertest.cc
+++ b/content/renderer/render_view_browsertest.cc
@@ -59,6 +59,7 @@
#include "third_party/WebKit/public/platform/WebURLResponse.h"
#include "third_party/WebKit/public/web/WebDataSource.h"
#include "third_party/WebKit/public/web/WebDeviceEmulationParams.h"
+#include "third_party/WebKit/public/web/WebHeap.h"
#include "third_party/WebKit/public/web/WebHistoryCommitType.h"
#include "third_party/WebKit/public/web/WebHistoryItem.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
@@ -87,6 +88,7 @@
#include "url/url_constants.h"
using blink::WebFrame;
+using blink::WebHeap;
using blink::WebInputEvent;
using blink::WebLocalFrame;
using blink::WebMouseEvent;
@@ -171,6 +173,13 @@ class RenderViewImplTest : public RenderViewTest {
RenderViewTest::SetUp();
}
+ // To avoid flaky leak reports, insist on GCing
+ // Blink upon shutdown to clear out garbage.
+ void TearDown() override {
+ WebHeap::collectGarbageForTesting();
haraken 2016/01/24 09:27:56 collectAllGarbageForTesting would be better.
sof 2016/01/24 12:35:18 That's what I thought would be tidier too, but for
+ RenderViewTest::TearDown();
+ }
+
RenderViewImpl* view() {
return static_cast<RenderViewImpl*>(view_);
}
@@ -501,7 +510,6 @@ TEST_F(RenderViewImplTest, OnNavStateChanged) {
EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching(
ViewHostMsg_UpdateState::ID));
}
- ProcessPendingMessages();
}
TEST_F(RenderViewImplTest, OnNavigationHttpPost) {
« 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