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

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: actually uploaded the files 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
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..2db17ef9bc03b1d24e87629b11ed590afc760cdc 100644
--- a/chrome/test/chromedriver/chrome_impl.cc
+++ b/chrome/test/chromedriver/chrome_impl.cc
@@ -14,6 +14,7 @@
#include "base/time.h"
#include "base/values.h"
#include "chrome/test/chromedriver/devtools_client_impl.h"
+#include "chrome/test/chromedriver/devtools_state.h"
#include "chrome/test/chromedriver/dom_tracker.h"
#include "chrome/test/chromedriver/frame_tracker.h"
#include "chrome/test/chromedriver/js.h"
@@ -120,23 +121,15 @@ Status ChromeImpl::Init() {
return Status(kUnknownError, "unable to discover open pages");
client_.reset(new DevToolsClientImpl(
socket_factory_, debugger_urls.front()));
+ client_state_.reset(new DevToolsState(client_.get()));
+ Status status = client_state_->Init();
+ if (status.IsError())
+ return status;
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);
- if (status.IsError())
- return status;
- // Enable page domain notifications to allow tracking navigation state.
- status = client_->SendCommand("Page.enable", params);
- if (status.IsError())
- return status;
- // Enable runtime events to allow tracking execution context creation.
- return client_->SendCommand("Runtime.enable", params);
+ client_->AddListener(client_state_.get());
+ return Status(kOk);
}
Status ChromeImpl::Load(const std::string& url) {

Powered by Google App Engine
This is Rietveld 408576698