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

Unified Diff: content/public/test/content_browser_test_utils.cc

Issue 818263004: Add a test that is a repro case for bug 444945. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autofill_crash'
Patch Set: Nasko's fixes Created 6 years 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 | « content/public/test/content_browser_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/content_browser_test_utils.cc
diff --git a/content/public/test/content_browser_test_utils.cc b/content/public/test/content_browser_test_utils.cc
index ff323c41145a02b9394867072e36e22360718f6e..d20e98e2c7f0322dfd8e0f26de5dde72ab5d6f0f 100644
--- a/content/public/test/content_browser_test_utils.cc
+++ b/content/public/test/content_browser_test_utils.cc
@@ -8,7 +8,6 @@
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/run_loop.h"
-#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/web_contents.h"
@@ -115,59 +114,5 @@ void ShellAddedObserver::ShellCreated(Shell* shell) {
runner_->QuitClosure().Run();
}
-class RenderViewCreatedObserver : public WebContentsObserver {
- public:
- explicit RenderViewCreatedObserver(WebContents* web_contents)
- : WebContentsObserver(web_contents),
- render_view_created_called_(false) {
- }
-
- // WebContentsObserver:
- void RenderViewCreated(RenderViewHost* rvh) override {
- render_view_created_called_ = true;
- }
-
- bool render_view_created_called_;
-};
-
-WebContentsAddedObserver::WebContentsAddedObserver()
- : web_contents_created_callback_(
- base::Bind(
- &WebContentsAddedObserver::WebContentsCreated,
- base::Unretained(this))),
- web_contents_(NULL) {
- WebContentsImpl::FriendZone::AddCreatedCallbackForTesting(
- web_contents_created_callback_);
-}
-
-WebContentsAddedObserver::~WebContentsAddedObserver() {
- WebContentsImpl::FriendZone::RemoveCreatedCallbackForTesting(
- web_contents_created_callback_);
-}
-
-void WebContentsAddedObserver::WebContentsCreated(WebContents* web_contents) {
- DCHECK(!web_contents_);
- web_contents_ = web_contents;
- child_observer_.reset(new RenderViewCreatedObserver(web_contents));
-
- if (runner_.get())
- runner_->QuitClosure().Run();
-}
-
-WebContents* WebContentsAddedObserver::GetWebContents() {
- if (web_contents_)
- return web_contents_;
-
- runner_ = new MessageLoopRunner();
- runner_->Run();
- return web_contents_;
-}
-
-bool WebContentsAddedObserver::RenderViewCreatedCalled() {
- if (child_observer_)
- return child_observer_->render_view_created_called_;
-
- return false;
-}
} // namespace content
« no previous file with comments | « content/public/test/content_browser_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698