| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_TEST_AUTOMATED_UI_TESTS_AUTOMATED_UI_TEST_BASE_H_ | 5 #ifndef CHROME_TEST_AUTOMATED_UI_TESTS_AUTOMATED_UI_TEST_BASE_H_ |
| 6 #define CHROME_TEST_AUTOMATED_UI_TESTS_AUTOMATED_UI_TEST_BASE_H_ | 6 #define CHROME_TEST_AUTOMATED_UI_TESTS_AUTOMATED_UI_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include "chrome/test/ui/ui_test.h" | 8 #include "chrome/test/ui/ui_test.h" |
| 9 | 9 |
| 10 class AutomatedUITestBase : public UITest { | 10 class AutomatedUITestBase : public UITest { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // Drags the active tab. | 51 // Drags the active tab. |
| 52 // If |drag_right| is true, if there is a tab to the right of the active tab, | 52 // If |drag_right| is true, if there is a tab to the right of the active tab, |
| 53 // the active tab is dragged to that tabs position. If |drag_right| is false, | 53 // the active tab is dragged to that tabs position. If |drag_right| is false, |
| 54 // if there is a tab to the left of the active tab, the active tab is dragged | 54 // if there is a tab to the left of the active tab, the active tab is dragged |
| 55 // to that tabs position. Returns true if the tab is dragged. If it returns | 55 // to that tabs position. Returns true if the tab is dragged. If it returns |
| 56 // false, the tab is not dragged, probably because no other tab exists to | 56 // false, the tab is not dragged, probably because no other tab exists to |
| 57 // drag the active tab over. | 57 // drag the active tab over. |
| 58 bool DragActiveTab(bool drag_right); | 58 bool DragActiveTab(bool drag_right); |
| 59 | 59 |
| 60 // Activates "find in page" on the current page. Returns true on success. |
| 61 bool FindInPage(); |
| 62 |
| 60 // Go forward in active tab. | 63 // Go forward in active tab. |
| 61 // Returns true if successful, false otherwise. | 64 // Returns true if successful, false otherwise. |
| 62 bool ForwardButton(); | 65 bool ForwardButton(); |
| 63 | 66 |
| 64 // Opens an OffTheRecord browser window. | 67 // Opens an OffTheRecord browser window. |
| 65 bool GoOffTheRecord(); | 68 bool GoOffTheRecord(); |
| 66 | 69 |
| 70 // Navigates to the Home page. |
| 71 // Returns true if call to activate the accelerator is successful. |
| 72 bool Home(); |
| 73 |
| 67 // Navigates the activate tab to given url. | 74 // Navigates the activate tab to given url. |
| 68 bool Navigate(const GURL& url); | 75 bool Navigate(const GURL& url); |
| 69 | 76 |
| 70 // Opens a new tab in the active window using an accelerator. | 77 // Opens a new tab in the active window using an accelerator. |
| 71 // Returns true if a new tab is successfully opened. | 78 // Returns true if a new tab is successfully opened. |
| 72 bool NewTab(); | 79 bool NewTab(); |
| 73 | 80 |
| 74 // Opens a new browser window by calling automation()->OpenNewBrowserWindow. | 81 // Opens a new browser window by calling automation()->OpenNewBrowserWindow. |
| 75 // Then activates the tab opened in the new window. | 82 // Then activates the tab opened in the new window. |
| 76 // Returns true if window is successfully created. | 83 // Returns true if window is successfully created. |
| 77 // If optional parameter previous_browser is passed in, it is set to be the | 84 // If optional parameter previous_browser is passed in, it is set to be the |
| 78 // previous browser window when new window is successfully created, and the | 85 // previous browser window when new window is successfully created, and the |
| 79 // caller owns previous_browser. | 86 // caller owns previous_browser. |
| 80 bool OpenAndActivateNewBrowserWindow( | 87 bool OpenAndActivateNewBrowserWindow( |
| 81 scoped_refptr<BrowserProxy>* previous_browser); | 88 scoped_refptr<BrowserProxy>* previous_browser); |
| 82 | 89 |
| 83 // Reload the active tab. | 90 // Reload the active tab. |
| 84 // Returns true if successful, false otherwise. | 91 // Returns true if successful, false otherwise. |
| 85 bool ReloadPage(); | 92 bool ReloadPage(); |
| 86 | 93 |
| 87 // Restores a previously closed tab. | 94 // Restores a previously closed tab. |
| 88 // Returns true if the tab is successfully restored. | 95 // Returns true if the tab is successfully restored. |
| 89 bool RestoreTab(); | 96 bool RestoreTab(); |
| 90 | 97 |
| 98 // Activates the next tab on the active browser window. |
| 99 // Returns true on success. |
| 100 bool SelectNextTab(); |
| 101 |
| 102 // Activates the previous tab on the active browser window. |
| 103 // Returns true on success. |
| 104 bool SelectPreviousTab(); |
| 105 |
| 106 // Displays the bookmark bar. |
| 107 // Returns true on success. |
| 108 bool ShowBookmarkBar(); |
| 109 |
| 110 // Opens the Downloads page in the current active browser window. |
| 111 // Returns true on success. |
| 112 bool ShowDownloads(); |
| 113 |
| 114 // Opens the History page in the current active browser window. |
| 115 // Returns true on success. |
| 116 bool ShowHistory(); |
| 117 |
| 91 // Runs the specified browser command in the current active browser. | 118 // Runs the specified browser command in the current active browser. |
| 92 // See browser_commands.cc for the list of commands. | 119 // See browser_commands.cc for the list of commands. |
| 93 // Returns true if the call is successfully dispatched. | 120 // Returns true if the call is successfully dispatched. |
| 94 // Possible failures include the active window is not a browser window or | 121 // Possible failures include the active window is not a browser window or |
| 95 // the message to apply the accelerator fails. | 122 // the message to apply the accelerator fails. |
| 96 bool RunCommandAsync(int browser_command); | 123 bool RunCommandAsync(int browser_command); |
| 97 | 124 |
| 98 // Runs the specified browser command in the current active browser, wait | 125 // Runs the specified browser command in the current active browser, wait |
| 99 // and return until the command has finished executing. | 126 // and return until the command has finished executing. |
| 100 // See browser_commands.cc for the list of commands. | 127 // See browser_commands.cc for the list of commands. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 121 scoped_refptr<WindowProxy> GetAndActivateWindowForBrowser( | 148 scoped_refptr<WindowProxy> GetAndActivateWindowForBrowser( |
| 122 BrowserProxy* browser); | 149 BrowserProxy* browser); |
| 123 | 150 |
| 124 private: | 151 private: |
| 125 scoped_refptr<BrowserProxy> active_browser_; | 152 scoped_refptr<BrowserProxy> active_browser_; |
| 126 | 153 |
| 127 DISALLOW_COPY_AND_ASSIGN(AutomatedUITestBase); | 154 DISALLOW_COPY_AND_ASSIGN(AutomatedUITestBase); |
| 128 }; | 155 }; |
| 129 | 156 |
| 130 #endif // CHROME_TEST_AUTOMATED_UI_TESTS_AUTOMATED_UI_TEST_BASE_H_ | 157 #endif // CHROME_TEST_AUTOMATED_UI_TESTS_AUTOMATED_UI_TEST_BASE_H_ |
| OLD | NEW |