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

Unified Diff: content/public/test/browser_test_utils.h

Issue 1155993003: Fix accessibility with out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixing unittests Created 5 years, 6 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
Index: content/public/test/browser_test_utils.h
diff --git a/content/public/test/browser_test_utils.h b/content/public/test/browser_test_utils.h
index 7de4fd7fcd1c14eeab59fc51e8498223d1a1ed6d..40b56a82146d19708b67ff54d37fa134694dada4 100644
--- a/content/public/test/browser_test_utils.h
+++ b/content/public/test/browser_test_utils.h
@@ -434,6 +434,25 @@ class FrameWatcher : public BrowserMessageFilter {
DISALLOW_COPY_AND_ASSIGN(FrameWatcher);
};
+// This observer keeps track of the last deleted RenderFrame to avoid
+// accessing it and causing use-after-free condition.
+class RenderFrameDeletedObserver : public WebContentsObserver {
+ public:
+ RenderFrameDeletedObserver(RenderFrameHost* rfh);
+ ~RenderFrameDeletedObserver() override;
+ void RenderFrameDeleted(RenderFrameHost* render_frame_host) override;
+ bool deleted();
+ void WaitUntilDeleted();
+
+ private:
+ int process_id_;
+ int routing_id_;
+ bool deleted_;
+ scoped_ptr<base::RunLoop> runner_;
+
+ DISALLOW_COPY_AND_ASSIGN(RenderFrameDeletedObserver);
+};
+
} // namespace content
#endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698