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

Unified Diff: chrome/browser/automation/testing_automation_provider.h

Issue 9372120: Implementation of AutomationEventQueue and associated framework to support generic non-blocking aut… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Nirnimesh's comments. Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/testing_automation_provider.h
diff --git a/chrome/browser/automation/testing_automation_provider.h b/chrome/browser/automation/testing_automation_provider.h
index 50c4c5e4692c2c6996f24b39ae4047df73facb20..6428f3a207340ebda0beaa0c148efbdfc54daea5 100644
--- a/chrome/browser/automation/testing_automation_provider.h
+++ b/chrome/browser/automation/testing_automation_provider.h
@@ -13,6 +13,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/automation/automation_event_observer.h"
+#include "chrome/browser/automation/automation_event_queue.h"
#include "chrome/browser/automation/automation_provider.h"
#include "chrome/browser/automation/automation_provider_json.h"
#include "chrome/browser/history/history.h"
@@ -944,6 +946,50 @@ class TestingAutomationProvider : public AutomationProvider,
void ExecuteJavascriptJSON(
base::DictionaryValue* args, IPC::Message* reply_message);
+ // Creates a DomRaisedEventObserver associated with the AutomationEventQueue.
+ // Example:
+ // input: { "event_name": "login complete",
+ // "windex": 1,
+ // "tab_index": 1,
+ // "frame_xpath": "//frames[1]",
+ // }
+ // output: { "observer_id": 1 }
+ void AddDomRaisedEventObserver(
+ base::DictionaryValue* args, IPC::Message* reply_message);
+
+ // Removes an event observer associated with the AutomationEventQueue.
+ // Example:
+ // input: { "observer_id": 1 }
+ // output: none
+ void RemoveEventObserver(
+ base::DictionaryValue* args, IPC::Message* reply_message);
+
+ // Retrieves an event from the AutomationEventQueue.
+ // Blocks if 'blocking' is true, otherwise returns immediately.
+ // Example:
+ // input: { "observer_id": 1,
+ // "blocking": true,
+ // }
+ // output: { "type": "raised",
+ // "name": "login complete"
+ // "id": 1,
+ // }
+ void GetQueuedEvent(base::DictionaryValue* args, IPC::Message* reply_message);
+
+ // Removes all events from the AutomationEventQueue.
+ // Example:
+ // input: none
+ // output: none
+ void ClearQueuedEvents(
+ base::DictionaryValue* args, IPC::Message* reply_message);
+
+ // Removes all event observers associated with the AutomationEventQueue.
+ // Example:
+ // input: none
+ // output: none
+ void ClearEventObservers(
+ base::DictionaryValue* args, IPC::Message* reply_message);
+
// Executes javascript in the specified frame of a render view.
// Uses the JSON interface. Waits for a result from the
// |DOMAutomationController|. The javascript must send a string.
@@ -1563,6 +1609,9 @@ class TestingAutomationProvider : public AutomationProvider,
// The stored data for the ImportSettings operation.
ImportSettingsData import_settings_data_;
+ // The automation event observer queue.
+ AutomationEventQueue automation_event_queue_;
+
DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider);
};

Powered by Google App Engine
This is Rietveld 408576698