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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ 5 #ifndef CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_
6 #define CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ 6 #define CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "chrome/browser/automation/automation_event_observer.h"
17 #include "chrome/browser/automation/automation_event_queue.h"
16 #include "chrome/browser/automation/automation_provider.h" 18 #include "chrome/browser/automation/automation_provider.h"
17 #include "chrome/browser/automation/automation_provider_json.h" 19 #include "chrome/browser/automation/automation_provider_json.h"
18 #include "chrome/browser/history/history.h" 20 #include "chrome/browser/history/history.h"
19 #include "chrome/browser/importer/importer_list_observer.h" 21 #include "chrome/browser/importer/importer_list_observer.h"
20 #include "chrome/browser/sync/profile_sync_service_harness.h" 22 #include "chrome/browser/sync/profile_sync_service_harness.h"
21 #include "chrome/browser/ui/browser_list.h" 23 #include "chrome/browser/ui/browser_list.h"
22 #include "content/public/browser/notification_registrar.h" 24 #include "content/public/browser/notification_registrar.h"
23 #include "content/public/common/page_type.h" 25 #include "content/public/common/page_type.h"
24 #include "content/public/common/security_style.h" 26 #include "content/public/common/security_style.h"
25 #include "net/base/cert_status_flags.h" 27 #include "net/base/cert_status_flags.h"
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 // output: { "result": "My Window Name" } 939 // output: { "result": "My Window Name" }
938 // This and some following methods have a suffix of JSON to distingush them 940 // This and some following methods have a suffix of JSON to distingush them
939 // from already existing methods which perform the same function, but use 941 // from already existing methods which perform the same function, but use
940 // custom IPC messages instead of the JSON IPC message. These functions will 942 // custom IPC messages instead of the JSON IPC message. These functions will
941 // eventually be replaced with the JSON ones and the JSON suffix will be 943 // eventually be replaced with the JSON ones and the JSON suffix will be
942 // dropped. 944 // dropped.
943 // TODO(kkania): Replace the non-JSON counterparts and drop the JSON suffix. 945 // TODO(kkania): Replace the non-JSON counterparts and drop the JSON suffix.
944 void ExecuteJavascriptJSON( 946 void ExecuteJavascriptJSON(
945 base::DictionaryValue* args, IPC::Message* reply_message); 947 base::DictionaryValue* args, IPC::Message* reply_message);
946 948
949 // Creates a DomRaisedEventObserver associated with the AutomationEventQueue.
950 // Example:
951 // input: { "event_name": "login complete",
952 // "windex": 1,
953 // "tab_index": 1,
954 // "frame_xpath": "//frames[1]",
955 // }
956 // output: { "observer_id": 1 }
957 void AddDomRaisedEventObserver(
958 base::DictionaryValue* args, IPC::Message* reply_message);
959
960 // Removes an event observer associated with the AutomationEventQueue.
961 // Example:
962 // input: { "observer_id": 1 }
963 // output: none
964 void RemoveEventObserver(
965 base::DictionaryValue* args, IPC::Message* reply_message);
966
967 // Retrieves an event from the AutomationEventQueue.
968 // Blocks if 'blocking' is true, otherwise returns immediately.
969 // Example:
970 // input: { "observer_id": 1,
971 // "blocking": true,
972 // }
973 // output: { "type": "raised",
974 // "name": "login complete"
975 // "id": 1,
976 // }
977 void GetQueuedEvent(base::DictionaryValue* args, IPC::Message* reply_message);
978
979 // Removes all events from the AutomationEventQueue.
980 // Example:
981 // input: none
982 // output: none
983 void ClearQueuedEvents(
984 base::DictionaryValue* args, IPC::Message* reply_message);
985
986 // Removes all event observers associated with the AutomationEventQueue.
987 // Example:
988 // input: none
989 // output: none
990 void ClearEventObservers(
991 base::DictionaryValue* args, IPC::Message* reply_message);
992
947 // Executes javascript in the specified frame of a render view. 993 // Executes javascript in the specified frame of a render view.
948 // Uses the JSON interface. Waits for a result from the 994 // Uses the JSON interface. Waits for a result from the
949 // |DOMAutomationController|. The javascript must send a string. 995 // |DOMAutomationController|. The javascript must send a string.
950 // Example: 996 // Example:
951 // input: { "view": { 997 // input: { "view": {
952 // "render_process_id": 1, 998 // "render_process_id": 1,
953 // "render_view_id": 2, 999 // "render_view_id": 2,
954 // } 1000 // }
955 // "frame_xpath": "//frames[1]", 1001 // "frame_xpath": "//frames[1]",
956 // "javascript": 1002 // "javascript":
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 HistoryService::Handle redirect_query_; 1602 HistoryService::Handle redirect_query_;
1557 1603
1558 content::NotificationRegistrar registrar_; 1604 content::NotificationRegistrar registrar_;
1559 1605
1560 // Used to enumerate browser profiles. 1606 // Used to enumerate browser profiles.
1561 scoped_refptr<ImporterList> importer_list_; 1607 scoped_refptr<ImporterList> importer_list_;
1562 1608
1563 // The stored data for the ImportSettings operation. 1609 // The stored data for the ImportSettings operation.
1564 ImportSettingsData import_settings_data_; 1610 ImportSettingsData import_settings_data_;
1565 1611
1612 // The automation event observer queue.
1613 AutomationEventQueue automation_event_queue_;
1614
1566 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); 1615 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider);
1567 }; 1616 };
1568 1617
1569 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ 1618 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698