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

Side by Side Diff: chrome/test/chromedriver/devtools_state.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, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/test/chromedriver/devtools_state.h"
6
7 #include <utility>
8
9 #include "base/json/json_writer.h"
10 #include "base/logging.h"
11 #include "base/values.h"
12 #include "chrome/test/chromedriver/devtools_client.h"
13 #include "chrome/test/chromedriver/status.h"
14
15 DevToolsState::DevToolsState(DevToolsClient* client)
16 : client_(client) {}
17
18 DevToolsState::~DevToolsState() {}
19
20 Status DevToolsState::Init() {
21 // Perform necessary configuration of the DevTools client.
22 // Fetch the root document node so that Inspector will push DOM node
23 // information to the client.
24 base::DictionaryValue params;
25 Status status = client_->SendCommand("DOM.getDocument", params);
26 if (status.IsError())
27 return status;
28 // Enable page domain notifications to allow tracking navigation state.
29 status = client_->SendCommand("Page.enable", params);
kkania 2013/01/30 18:50:29 So actually, Page.enable and Runtime.enable only n
kkania 2013/01/30 20:33:24 Wait nevermind, this is only done once per connect
craigdh 2013/01/30 21:35:08 Ok, I'll just fold this class's functionality into
30 if (status.IsError())
31 return status;
32 // Enable runtime events to allow tracking execution context creation.
33 return client_->SendCommand("Runtime.enable", params);
34 }
35
36 void DevToolsState::OnEvent(const std::string& method,
37 const base::DictionaryValue& params) {
38 if (method == "DOM.documentUpdated") {
39 base::DictionaryValue params;
40 client_->SendCommand("DOM.getDocument", params);
41 }
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698