| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 // Trigger browser action asynchronously in the active tab. | 513 // Trigger browser action asynchronously in the active tab. |
| 514 // Uses the JSON interface for input/output. | 514 // Uses the JSON interface for input/output. |
| 515 void TriggerBrowserActionById(base::DictionaryValue* args, | 515 void TriggerBrowserActionById(base::DictionaryValue* args, |
| 516 IPC::Message* reply_message); | 516 IPC::Message* reply_message); |
| 517 | 517 |
| 518 // Auto-updates installed extensions. | 518 // Auto-updates installed extensions. |
| 519 // Uses the JSON interface for input/output. | 519 // Uses the JSON interface for input/output. |
| 520 void UpdateExtensionsNow(base::DictionaryValue* args, | 520 void UpdateExtensionsNow(base::DictionaryValue* args, |
| 521 IPC::Message* reply_message); | 521 IPC::Message* reply_message); |
| 522 | 522 |
| 523 #if !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) | |
| 524 // Dumps a heap profile. | |
| 525 // It also checks whether the heap profiler is running, or not. | |
| 526 // Uses the JSON interface for input/output. | |
| 527 void HeapProfilerDump(base::DictionaryValue* args, | |
| 528 IPC::Message* reply_message); | |
| 529 #endif // !defined(NO_TCMALLOC) && (defined(OS_LINUX) || defined(OS_CHROMEOS)) | |
| 530 | |
| 531 // Overrides the current geoposition. | 523 // Overrides the current geoposition. |
| 532 // Uses the JSON interface for input/output. | 524 // Uses the JSON interface for input/output. |
| 533 void OverrideGeoposition(base::DictionaryValue* args, | 525 void OverrideGeoposition(base::DictionaryValue* args, |
| 534 IPC::Message* reply_message); | 526 IPC::Message* reply_message); |
| 535 | 527 |
| 536 // Responds to the Find request and returns the match count. | 528 // Responds to the Find request and returns the match count. |
| 537 void FindInPage(Browser* browser, | 529 void FindInPage(Browser* browser, |
| 538 base::DictionaryValue* args, | 530 base::DictionaryValue* args, |
| 539 IPC::Message* reply_message); | 531 IPC::Message* reply_message); |
| 540 | 532 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 void IsFullscreenBubbleDisplayingButtons(Browser* browser, | 648 void IsFullscreenBubbleDisplayingButtons(Browser* browser, |
| 657 base::DictionaryValue* args, | 649 base::DictionaryValue* args, |
| 658 IPC::Message* reply_message); | 650 IPC::Message* reply_message); |
| 659 void AcceptCurrentFullscreenOrMouseLockRequest(Browser* browser, | 651 void AcceptCurrentFullscreenOrMouseLockRequest(Browser* browser, |
| 660 base::DictionaryValue* args, | 652 base::DictionaryValue* args, |
| 661 IPC::Message* reply_message); | 653 IPC::Message* reply_message); |
| 662 void DenyCurrentFullscreenOrMouseLockRequest(Browser* browser, | 654 void DenyCurrentFullscreenOrMouseLockRequest(Browser* browser, |
| 663 base::DictionaryValue* args, | 655 base::DictionaryValue* args, |
| 664 IPC::Message* reply_message); | 656 IPC::Message* reply_message); |
| 665 | 657 |
| 666 // Waits for all views to stop loading or a modal dialog to become active. | |
| 667 void WaitForAllViewsToStopLoading(base::DictionaryValue* args, | |
| 668 IPC::Message* reply_message); | |
| 669 | |
| 670 // Gets the browser and tab index of the given tab. Uses the JSON interface. | 658 // Gets the browser and tab index of the given tab. Uses the JSON interface. |
| 671 // Either "tab_id" or "tab_handle" must be specified, but not both. "tab_id" | 659 // Either "tab_id" or "tab_handle" must be specified, but not both. "tab_id" |
| 672 // refers to the ID from the |NavigationController|, while "tab_handle" is | 660 // refers to the ID from the |NavigationController|, while "tab_handle" is |
| 673 // the handle number assigned by the automation system. | 661 // the handle number assigned by the automation system. |
| 674 // Example: | 662 // Example: |
| 675 // input: { "tab_id": 1, // optional | 663 // input: { "tab_id": 1, // optional |
| 676 // "tab_handle": 3 // optional | 664 // "tab_handle": 3 // optional |
| 677 // } | 665 // } |
| 678 // output: { "windex": 1, "tab_index": 5 } | 666 // output: { "windex": 1, "tab_index": 5 } |
| 679 void GetIndicesFromTab(base::DictionaryValue* args, | 667 void GetIndicesFromTab(base::DictionaryValue* args, |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 // The pair |windex| and |tab_index| or the single |auto_id| must be given | 859 // The pair |windex| and |tab_index| or the single |auto_id| must be given |
| 872 // to specify the tab. | 860 // to specify the tab. |
| 873 // Example: | 861 // Example: |
| 874 // input: { "windex": 1, | 862 // input: { "windex": 1, |
| 875 // "tab_index": 1, | 863 // "tab_index": 1, |
| 876 // "auto_id": { "type": 0, "id": "awoein" } | 864 // "auto_id": { "type": 0, "id": "awoein" } |
| 877 // } | 865 // } |
| 878 // output: { "result": AUTOMATION_MSG_NAVIGATION_SUCCESS // optional } | 866 // output: { "result": AUTOMATION_MSG_NAVIGATION_SUCCESS // optional } |
| 879 void ReloadJSON(base::DictionaryValue* args, IPC::Message* reply_message); | 867 void ReloadJSON(base::DictionaryValue* args, IPC::Message* reply_message); |
| 880 | 868 |
| 881 // Captures the entire page of the the specified tab, including the | |
| 882 // non-visible portions of the page, and saves the PNG to a file. | |
| 883 // The pair |windex| and |tab_index| or the single |auto_id| must be given | |
| 884 // to specify the tab. | |
| 885 // Example: | |
| 886 // input: { "windex": 1, | |
| 887 // "tab_index": 1, | |
| 888 // "auto_id": { "type": 0, "id": "awoein" }, | |
| 889 // "path": "/tmp/foo.png" | |
| 890 // } | |
| 891 // output: none | |
| 892 void CaptureEntirePageJSON( | |
| 893 base::DictionaryValue* args, IPC::Message* reply_message); | |
| 894 | |
| 895 // Gets the cookies for the given URL. Uses the JSON interface. | 869 // Gets the cookies for the given URL. Uses the JSON interface. |
| 896 // "expiry" refers to the amount of seconds since the Unix epoch. If omitted, | 870 // "expiry" refers to the amount of seconds since the Unix epoch. If omitted, |
| 897 // the cookie is valid for the duration of the browser session. | 871 // the cookie is valid for the duration of the browser session. |
| 898 // Example: | 872 // Example: |
| 899 // input: { "url": "http://www.google.com" } | 873 // input: { "url": "http://www.google.com" } |
| 900 // output: { "cookies": [ | 874 // output: { "cookies": [ |
| 901 // { | 875 // { |
| 902 // "name": "PREF", | 876 // "name": "PREF", |
| 903 // "value": "123101", | 877 // "value": "123101", |
| 904 // "path": "/", | 878 // "path": "/", |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 // "windowsKeyCode": ui::VKEY_X, | 1136 // "windowsKeyCode": ui::VKEY_X, |
| 1163 // "unmodifiedText": "x", | 1137 // "unmodifiedText": "x", |
| 1164 // "text": "X", | 1138 // "text": "X", |
| 1165 // "modifiers": automation::kShiftKeyMask, | 1139 // "modifiers": automation::kShiftKeyMask, |
| 1166 // "isSystemKey": false | 1140 // "isSystemKey": false |
| 1167 // } | 1141 // } |
| 1168 // output: none | 1142 // output: none |
| 1169 void SendWebkitKeyEvent(base::DictionaryValue* args, | 1143 void SendWebkitKeyEvent(base::DictionaryValue* args, |
| 1170 IPC::Message* message); | 1144 IPC::Message* message); |
| 1171 | 1145 |
| 1172 // Processes the WebKit mouse event with the specified properties. | |
| 1173 // The pair |windex| and |tab_index| or the single |auto_id| must be given | |
| 1174 // to specify the render view. | |
| 1175 // Example: | |
| 1176 // input: { "windex": 1, | |
| 1177 // "tab_index": 1, | |
| 1178 // "auto_id": { "type": 0, "id": "awoein" }, | |
| 1179 // "type": automation::kMouseDown, | |
| 1180 // "button": automation::kLeftButton, | |
| 1181 // "x": 100, | |
| 1182 // "y": 200, | |
| 1183 // "click_count": 1, | |
| 1184 // "modifiers": automation::kShiftKeyMask, | |
| 1185 // } | |
| 1186 // output: none | |
| 1187 void ProcessWebMouseEvent(base::DictionaryValue* args, | |
| 1188 IPC::Message* message); | |
| 1189 | |
| 1190 // Gets the active JavaScript modal dialog's message. | 1146 // Gets the active JavaScript modal dialog's message. |
| 1191 // Example: | 1147 // Example: |
| 1192 // input: none | 1148 // input: none |
| 1193 // output: { "message": "This is an alert!" } | 1149 // output: { "message": "This is an alert!" } |
| 1194 void GetAppModalDialogMessage( | 1150 void GetAppModalDialogMessage( |
| 1195 base::DictionaryValue* args, IPC::Message* reply_message); | 1151 base::DictionaryValue* args, IPC::Message* reply_message); |
| 1196 | 1152 |
| 1197 // Accepts or dismisses the active JavaScript modal dialog. If optional | 1153 // Accepts or dismisses the active JavaScript modal dialog. If optional |
| 1198 // prompt text is given, it will be used as the result of the prompt dialog. | 1154 // prompt text is given, it will be used as the result of the prompt dialog. |
| 1199 // Example: | 1155 // Example: |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1514 scoped_ptr<AutomationEventQueue> automation_event_queue_; | 1470 scoped_ptr<AutomationEventQueue> automation_event_queue_; |
| 1515 | 1471 |
| 1516 // List of commands which just finish synchronously and don't require | 1472 // List of commands which just finish synchronously and don't require |
| 1517 // setting up an observer. | 1473 // setting up an observer. |
| 1518 static const int kSynchronousCommands[]; | 1474 static const int kSynchronousCommands[]; |
| 1519 | 1475 |
| 1520 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); | 1476 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); |
| 1521 }; | 1477 }; |
| 1522 | 1478 |
| 1523 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ | 1479 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ |
| OLD | NEW |