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

Unified Diff: chrome/test/chromedriver/dom_tracker.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 | « chrome/test/chromedriver/dom_tracker.h ('k') | chrome/test/chromedriver/dom_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/dom_tracker.cc
diff --git a/chrome/test/chromedriver/dom_tracker.cc b/chrome/test/chromedriver/dom_tracker.cc
index bbd36c46f950cb86c54963c49fc2f21c5c7a12cf..1b98e9ad994c41d09feb7fd42c3529dee4240e54 100644
--- a/chrome/test/chromedriver/dom_tracker.cc
+++ b/chrome/test/chromedriver/dom_tracker.cc
@@ -11,10 +11,19 @@
#include "base/values.h"
#include "chrome/test/chromedriver/status.h"
-DomTracker::DomTracker() {}
+DomTracker::DomTracker(DevToolsClient* client) : client_(client) {
+ DCHECK(client_);
+}
DomTracker::~DomTracker() {}
+Status DomTracker::Init() {
+ // Fetch the root document node so that Inspector will push DOM node
+ // information to the client.
+ base::DictionaryValue params;
+ return client_->SendCommand("DOM.getDocument", params);
+}
+
Status DomTracker::GetFrameIdForNode(
int node_id, std::string* frame_id) {
if (node_to_frame_map_.count(node_id) == 0)
@@ -38,6 +47,8 @@ void DomTracker::OnEvent(const std::string& method,
}
} else if (method == "DOM.documentUpdated") {
node_to_frame_map_.clear();
+ base::DictionaryValue params;
+ client_->SendCommand("DOM.getDocument", params);
}
}
« no previous file with comments | « chrome/test/chromedriver/dom_tracker.h ('k') | chrome/test/chromedriver/dom_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698