| 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 | |
| 63 // Go forward in active tab. | 60 // Go forward in active tab. |
| 64 // Returns true if successful, false otherwise. | 61 // Returns true if successful, false otherwise. |
| 65 bool ForwardButton(); | 62 bool ForwardButton(); |
| 66 | 63 |
| 67 // Opens an OffTheRecord browser window. | 64 // Opens an OffTheRecord browser window. |
| 68 bool GoOffTheRecord(); | 65 bool GoOffTheRecord(); |
| 69 | 66 |
| 70 // Navigates to the Home page. | |
| 71 // Returns true if call to activate the accelerator is successful. | |
| 72 bool Home(); | |
| 73 | |
| 74 // Navigates the activate tab to given url. | 67 // Navigates the activate tab to given url. |
| 75 bool Navigate(const GURL& url); | 68 bool Navigate(const GURL& url); |
| 76 | 69 |
| 77 // Opens a new tab in the active window using an accelerator. | 70 // Opens a new tab in the active window using an accelerator. |
| 78 // Returns true if a new tab is successfully opened. | 71 // Returns true if a new tab is successfully opened. |
| 79 bool NewTab(); | 72 bool NewTab(); |
| 80 | 73 |
| 81 // Opens a new browser window by calling automation()->OpenNewBrowserWindow. | 74 // Opens a new browser window by calling automation()->OpenNewBrowserWindow. |
| 82 // Then activates the tab opened in the new window. | 75 // Then activates the tab opened in the new window. |
| 83 // Returns true if window is successfully created. | 76 // Returns true if window is successfully created. |
| 84 // If optional parameter previous_browser is passed in, it is set to be the | 77 // If optional parameter previous_browser is passed in, it is set to be the |
| 85 // previous browser window when new window is successfully created, and the | 78 // previous browser window when new window is successfully created, and the |
| 86 // caller owns previous_browser. | 79 // caller owns previous_browser. |
| 87 bool OpenAndActivateNewBrowserWindow( | 80 bool OpenAndActivateNewBrowserWindow( |
| 88 scoped_refptr<BrowserProxy>* previous_browser); | 81 scoped_refptr<BrowserProxy>* previous_browser); |
| 89 | 82 |
| 90 // Reload the active tab. | 83 // Reload the active tab. |
| 91 // Returns true if successful, false otherwise. | 84 // Returns true if successful, false otherwise. |
| 92 bool ReloadPage(); | 85 bool ReloadPage(); |
| 93 | 86 |
| 94 // Restores a previously closed tab. | 87 // Restores a previously closed tab. |
| 95 // Returns true if the tab is successfully restored. | 88 // Returns true if the tab is successfully restored. |
| 96 bool RestoreTab(); | 89 bool RestoreTab(); |
| 97 | 90 |
| 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 | |
| 118 // Runs the specified browser command in the current active browser. | 91 // Runs the specified browser command in the current active browser. |
| 119 // See browser_commands.cc for the list of commands. | 92 // See browser_commands.cc for the list of commands. |
| 120 // Returns true if the call is successfully dispatched. | 93 // Returns true if the call is successfully dispatched. |
| 121 // Possible failures include the active window is not a browser window or | 94 // Possible failures include the active window is not a browser window or |
| 122 // the message to apply the accelerator fails. | 95 // the message to apply the accelerator fails. |
| 123 bool RunCommandAsync(int browser_command); | 96 bool RunCommandAsync(int browser_command); |
| 124 | 97 |
| 125 // Runs the specified browser command in the current active browser, wait | 98 // Runs the specified browser command in the current active browser, wait |
| 126 // and return until the command has finished executing. | 99 // and return until the command has finished executing. |
| 127 // See browser_commands.cc for the list of commands. | 100 // See browser_commands.cc for the list of commands. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 148 scoped_refptr<WindowProxy> GetAndActivateWindowForBrowser( | 121 scoped_refptr<WindowProxy> GetAndActivateWindowForBrowser( |
| 149 BrowserProxy* browser); | 122 BrowserProxy* browser); |
| 150 | 123 |
| 151 private: | 124 private: |
| 152 scoped_refptr<BrowserProxy> active_browser_; | 125 scoped_refptr<BrowserProxy> active_browser_; |
| 153 | 126 |
| 154 DISALLOW_COPY_AND_ASSIGN(AutomatedUITestBase); | 127 DISALLOW_COPY_AND_ASSIGN(AutomatedUITestBase); |
| 155 }; | 128 }; |
| 156 | 129 |
| 157 #endif // CHROME_TEST_AUTOMATED_UI_TESTS_AUTOMATED_UI_TEST_BASE_H_ | 130 #endif // CHROME_TEST_AUTOMATED_UI_TESTS_AUTOMATED_UI_TEST_BASE_H_ |
| OLD | NEW |