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

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

Issue 8790003: Allow the automation provider to accept an ID for performing render-view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years 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 c4157f90ca7cfb4840f36495d793824f16d7aaaa..4279bd05900781710552aa1e5ebbe9176ea334f6 100644
--- a/chrome/browser/automation/testing_automation_provider.h
+++ b/chrome/browser/automation/testing_automation_provider.h
@@ -646,16 +646,14 @@ class TestingAutomationProvider : public AutomationProvider,
// Uninstalls the extension with the given id.
// Uses the JSON interface for input/output.
- void UninstallExtensionById(Browser* browser,
- base::DictionaryValue* args,
+ void UninstallExtensionById(base::DictionaryValue* args,
IPC::Message* reply_message);
// Set extension states:
// Enable/disable extension.
// Allow/disallow extension in incognito mode.
// Uses the JSON interface for input/output.
- void SetExtensionStateById(Browser* browser,
- base::DictionaryValue* args,
+ void SetExtensionStateById(base::DictionaryValue* args,
IPC::Message* reply_message);
// Trigger page action asynchronously in the active tab.
@@ -890,9 +888,12 @@ class TestingAutomationProvider : public AutomationProvider,
IPC::Message* reply_message);
// Navigates to the given URL. Uses the JSON interface.
+ // The pair |windex| and |tab_index| or the single |tab_id| must be given
+ // to specify the tab.
// Example:
// input: { "windex": 1,
// "tab_index": 3,
+ // "tab_id": { "type": 0, "id": "awoein" },
// "url": "http://www.google.com",
// "navigation_count": 1 // number of navigations to wait for
// }
@@ -902,9 +903,12 @@ class TestingAutomationProvider : public AutomationProvider,
// Executes javascript in the specified frame. Uses the JSON interface.
// Waits for a result from the |DOMAutomationController|. The javascript
// must send a string.
+ // The pair |windex| and |tab_index| or the single |tab_id| must be given
+ // to specify the tab.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "tab_id": { "type": 0, "id": "awoein" },
// "frame_xpath": "//frames[1]",
// "javascript":
// "window.domAutomationController.send(window.name)",
@@ -936,44 +940,52 @@ class TestingAutomationProvider : public AutomationProvider,
base::DictionaryValue* args, IPC::Message* reply_message);
// Goes forward in the specified tab. Uses the JSON interface.
+ // The pair |windex| and |tab_index| or the single |tab_id| must be given
+ // to specify the tab.
// Example:
- // input: { "windex": 1, "tab_index": 1 }
+ // input: { "windex": 1,
+ // "tab_index": 1,
+ // "tab_id": { "type": 0, "id": "awoein" }
+ // }
// output: { "did_go_forward": true, // optional
// "result": AUTOMATION_MSG_NAVIGATION_SUCCESS // optional
// }
void GoForward(base::DictionaryValue* args, IPC::Message* reply_message);
// Goes back in the specified tab. Uses the JSON interface.
+ // The pair |windex| and |tab_index| or the single |tab_id| must be given
+ // to specify the tab.
// Example:
- // input: { "windex": 1, "tab_index": 1 }
+ // input: { "windex": 1,
+ // "tab_index": 1,
+ // "tab_id": { "type": 0, "id": "awoein" }
+ // }
// output: { "did_go_back": true, // optional
// "result": AUTOMATION_MSG_NAVIGATION_SUCCESS // optional
// }
void GoBack(base::DictionaryValue* args, IPC::Message* reply_message);
// Reload the specified tab. Uses the JSON interface.
+ // The pair |windex| and |tab_index| or the single |tab_id| must be given
+ // to specify the tab.
// Example:
- // input: { "windex": 1, "tab_index": 1 }
+ // input: { "windex": 1,
+ // "tab_index": 1,
+ // "tab_id": { "type": 0, "id": "awoein" }
+ // }
// output: { "result": AUTOMATION_MSG_NAVIGATION_SUCCESS // optional }
void ReloadJSON(base::DictionaryValue* args, IPC::Message* reply_message);
- // Get the current url of the specified tab. Uses the JSON interface.
- // Example:
- // input: { "windex": 1, "tab_index": 1 }
- // output: { "url": "http://www.google.com" }
- void GetTabURLJSON(base::DictionaryValue* args, IPC::Message* reply_message);
-
- // Get the current url of the specified tab. Uses the JSON interface.
- // Example:
- // input: { "windex": 1, "tab_index": 1 }
- // output: { "title": "Google" }
- void GetTabTitleJSON(base::DictionaryValue* args,
- IPC::Message* reply_message);
-
// Captures the entire page of the the specified tab, including the
// non-visible portions of the page, and saves the PNG to a file.
+ // The pair |windex| and |tab_index| or the single |tab_id| must be given
+ // to specify the tab.
// Example:
- // input: { "windex": 1, "tab_index": 1, "path":"/tmp/foo.png"}
+ // input: { "windex": 1,
+ // "tab_index": 1,
+ // "tab_id": { "type": 0, "id": "awoein" },
+ // "path": "/tmp/foo.png"
+ // }
// output: none
void CaptureEntirePageJSON(
base::DictionaryValue* args, IPC::Message* reply_message);
@@ -1034,25 +1046,51 @@ class TestingAutomationProvider : public AutomationProvider,
// Gets the ID for every open tab. This ID is unique per session.
// Example:
// input: none
- // output: { "ids": [4124, 213, 1] }
+ // output: { "ids": [213, 1] }
void GetTabIds(base::DictionaryValue* args, IPC::Message* reply_message);
+ // Gets info about all open views. Each view ID is unique per session.
+ // Example:
+ // input: none
+ // output: { "views": [
+ // { "type": 0,
+ // "view_id": "0|1902",
+ // "extension_id": "askjeoias3" // optional
+ // }
+ // ]
+ // }
+ void GetViews(base::DictionaryValue* args, IPC::Message* reply_message);
+
// Checks if the given tab ID refers to an open tab.
// Example:
// input: { "id": 41 }
// output: { "is_valid": false }
void IsTabIdValid(base::DictionaryValue* args, IPC::Message* reply_message);
+ // Checks if the given view ID refers to an open view.
+ // Example:
+ // input: { "id": "0|1902" }
+ // output: { "is_valid": false }
+ void DoesViewExist(base::DictionaryValue* args, IPC::Message* reply_message);
+
// Closes the specified tab.
+ // The pair |windex| and |tab_index| or the single |tab_id| must be given
+ // to specify the tab.
// Example:
- // input: { "windex": 1, "tab_index": 1 }
+ // input: { "windex": 1,
+ // "tab_index": 1,
+ // "tab_id": { "type": 0, "id": "awoein" }
+ // }
// output: none
void CloseTabJSON(base::DictionaryValue* args, IPC::Message* reply_message);
// Sends the WebKit events for a mouse click at a given coordinate.
+ // The pair |windex| and |tab_index| or the single |view_id| must be given
+ // to specify the render view.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "view_id": { "type": 0, "id": "awoein" },
// "button": automation::kLeftButton,
// "x": 100,
// "y": 100
@@ -1062,9 +1100,12 @@ class TestingAutomationProvider : public AutomationProvider,
IPC::Message* message);
// Sends the WebKit event for a mouse move to a given coordinate.
+ // The pair |windex| and |tab_index| or the single |view_id| must be given
+ // to specify the render view.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "view_id": { "type": 0, "id": "awoein" },
// "x": 100,
// "y": 100
// }
@@ -1073,9 +1114,12 @@ class TestingAutomationProvider : public AutomationProvider,
IPC::Message* message);
// Sends the WebKit events for a mouse drag between two coordinates.
+ // The pair |windex| and |tab_index| or the single |view_id| must be given
+ // to specify the render view.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "view_id": { "type": 0, "id": "awoein" },
// "start_x": 100,
// "start_y": 100,
// "end_x": 100,
@@ -1086,9 +1130,12 @@ class TestingAutomationProvider : public AutomationProvider,
IPC::Message* message);
// Sends the WebKit events for a mouse button down at a given coordinate.
+ // The pair |windex| and |tab_index| or the single |view_id| must be given
+ // to specify the render view.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "view_id": { "type": 0, "id": "awoein" },
// "x": 100,
// "y": 100
// }
@@ -1097,9 +1144,12 @@ class TestingAutomationProvider : public AutomationProvider,
IPC::Message* message);
// Sends the WebKit events for a mouse button up at a given coordinate.
+ // The pair |windex| and |tab_index| or the single |view_id| must be given
+ // to specify the render view.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "view_id": { "type": 0, "id": "awoein" },
// "x": 100,
// "y": 100
// }
@@ -1108,9 +1158,12 @@ class TestingAutomationProvider : public AutomationProvider,
IPC::Message* message);
// Sends the WebKit events for a mouse double click at a given coordinate.
+ // The pair |windex| and |tab_index| or the single |view_id| must be given
+ // to specify the render view.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "view_id": { "type": 0, "id": "awoein" },
// "x": 100,
// "y": 100
// }
@@ -1119,9 +1172,12 @@ class TestingAutomationProvider : public AutomationProvider,
IPC::Message* message);
// Drag and drop file paths at a given coordinate.
+ // The pair |windex| and |tab_index| or the single |view_id| must be given
+ // to specify the render view.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "view_id": { "type": 0, "id": "awoein" },
// "x": 100,
// "y": 100,
// "paths": [
@@ -1133,9 +1189,12 @@ class TestingAutomationProvider : public AutomationProvider,
IPC::Message* message);
// Sends the WebKit key event with the specified properties.
+ // The pair |windex| and |tab_index| or the single |view_id| must be given
+ // to specify the render view.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "view_id": { "type": 0, "id": "awoein" },
// "type": automation::kRawKeyDownType,
// "nativeKeyCode": ui::VKEY_X,
// "windowsKeyCode": ui::VKEY_X,
@@ -1151,9 +1210,12 @@ class TestingAutomationProvider : public AutomationProvider,
// Sends the key event from the OS level to the browser window,
// allowing it to be preprocessed by some external application (ie. IME).
// Will switch to the tab specified by tab_index before sending the event.
+ // The pair |windex| and |tab_index| or the single |tab_id| must be given
+ // to specify the tab.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "tab_id": { "type": 0, "id": "awoein" },
// "keyCode": ui::VKEY_X,
// "modifiers": automation::kShiftKeyMask,
// }
@@ -1182,9 +1244,12 @@ class TestingAutomationProvider : public AutomationProvider,
base::DictionaryValue* args, IPC::Message* reply_message);
// Activates the given tab.
+ // The pair |windex| and |tab_index| or the single |tab_id| must be given
+ // to specify the tab.
// Example:
// input: { "windex": 1,
// "tab_index": 1,
+ // "tab_id": { "type": 0, "id": "awoein" }
// }
// output: none
void ActivateTabJSON(base::DictionaryValue* args, IPC::Message* message);

Powered by Google App Engine
This is Rietveld 408576698