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

Unified Diff: chrome/test/chromedriver/chrome_impl.cc

Issue 12093057: [ChromeDriver] Send DOM.getDocument after each DOM.documentUpdated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile error on win_rel Created 7 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 | chrome/test/chromedriver/devtools_client_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome_impl.cc
diff --git a/chrome/test/chromedriver/chrome_impl.cc b/chrome/test/chromedriver/chrome_impl.cc
index 00871ebcbf870c76370a46ce1f35fae766259a94..e51d40b565eeaa02f62c8f0757d34d097d7092b3 100644
--- a/chrome/test/chromedriver/chrome_impl.cc
+++ b/chrome/test/chromedriver/chrome_impl.cc
@@ -94,7 +94,6 @@ ChromeImpl::ChromeImpl(base::ProcessHandle process,
context_getter_(context_getter),
port_(port),
socket_factory_(socket_factory),
- dom_tracker_(new DomTracker()),
frame_tracker_(new FrameTracker()),
navigation_tracker_(new NavigationTracker()) {
if (user_data_dir->IsValid()) {
@@ -120,23 +119,20 @@ Status ChromeImpl::Init() {
return Status(kUnknownError, "unable to discover open pages");
client_.reset(new DevToolsClientImpl(
socket_factory_, debugger_urls.front()));
- client_->AddListener(dom_tracker_.get());
- client_->AddListener(frame_tracker_.get());
- client_->AddListener(navigation_tracker_.get());
-
- // Perform necessary configuration of the DevTools client.
- // Fetch the root document node so that Inspector will push DOM node
- // information to the client.
- base::DictionaryValue params;
- Status status = client_->SendCommand("DOM.getDocument", params);
+ dom_tracker_.reset(new DomTracker(client_.get()));
+ Status status = dom_tracker_->Init();
if (status.IsError())
return status;
- // Enable page domain notifications to allow tracking navigation state.
- status = client_->SendCommand("Page.enable", params);
+ status = frame_tracker_->Init(client_.get());
if (status.IsError())
return status;
- // Enable runtime events to allow tracking execution context creation.
- return client_->SendCommand("Runtime.enable", params);
+ status = navigation_tracker_->Init(client_.get());
+ if (status.IsError())
+ return status;
+ client_->AddListener(dom_tracker_.get());
+ client_->AddListener(frame_tracker_.get());
+ client_->AddListener(navigation_tracker_.get());
+ return Status(kOk);
}
Status ChromeImpl::Load(const std::string& url) {
« no previous file with comments | « no previous file | chrome/test/chromedriver/devtools_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698