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

Unified Diff: chrome/test/chromedriver/dom_tracker.h

Issue 11639019: [chromedriver] Implement SwitchToFrame command. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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/commands_unittest.cc ('k') | chrome/test/chromedriver/dom_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/dom_tracker.h
diff --git a/chrome/test/chromedriver/dom_tracker.h b/chrome/test/chromedriver/dom_tracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..0282de5ff6b5b3354521acc2baba2c99cfc6ed18
--- /dev/null
+++ b/chrome/test/chromedriver/dom_tracker.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_TEST_CHROMEDRIVER_DOM_TRACKER_H_
+#define CHROME_TEST_CHROMEDRIVER_DOM_TRACKER_H_
+
+#include <map>
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "chrome/test/chromedriver/devtools_event_listener.h"
+
+namespace base {
+class DictionaryValue;
+class Value;
+}
+
+class Status;
+
+// Tracks the state of the DOM and execution context creation.
+class DomTracker : public DevToolsEventListener {
+ public:
+ DomTracker();
+ virtual ~DomTracker();
+
+ Status GetFrameIdForNode(int node_id, std::string* frame_id);
+ Status GetContextIdForFrame(const std::string& frame_id, int* context_id);
+
+ // Overridden from DevToolsEventListener:
+ virtual void OnEvent(const std::string& method,
+ const base::DictionaryValue& params) OVERRIDE;
+
+ private:
+ bool ProcessNodeList(const base::Value* nodes);
+ bool ProcessNode(const base::Value* node);
+
+ typedef std::map<int, std::string> NodeToFrameMap;
+ typedef std::map<std::string, int> FrameToContextMap;
+ NodeToFrameMap node_to_frame_map_;
+ FrameToContextMap frame_to_context_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(DomTracker);
+};
+
+#endif // CHROME_TEST_CHROMEDRIVER_DOM_TRACKER_H_
« no previous file with comments | « chrome/test/chromedriver/commands_unittest.cc ('k') | chrome/test/chromedriver/dom_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698