OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WEBDRIVER_WEBDRIVER_SESSION_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_ |
6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_ | 6 #define CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 ~Session(); | 70 ~Session(); |
71 | 71 |
72 // Starts the session thread and a new browser, using the exe found at | 72 // Starts the session thread and a new browser, using the exe found at |
73 // |browser_exe| and duplicating the provided |user_data_dir|. | 73 // |browser_exe| and duplicating the provided |user_data_dir|. |
74 // If |browser_exe| is empty, it will search in all the default locations. | 74 // If |browser_exe| is empty, it will search in all the default locations. |
75 // It |user_data_dir| is empty, it will use a temporary dir. | 75 // It |user_data_dir| is empty, it will use a temporary dir. |
76 // Returns true on success. On failure, the session will delete | 76 // Returns true on success. On failure, the session will delete |
77 // itself and return an error code. | 77 // itself and return an error code. |
78 Error* Init(const Automation::BrowserOptions& options); | 78 Error* Init(const Automation::BrowserOptions& options); |
79 | 79 |
80 // Should be called before executing a command. Performs necessary waits | 80 // Should be called before executing a command. |
81 // and frame switching. | |
82 Error* BeforeExecuteCommand(); | 81 Error* BeforeExecuteCommand(); |
83 | 82 |
| 83 // Should be called after executing a command. |
| 84 Error* AfterExecuteCommand(); |
| 85 |
84 // Terminates this session and deletes itself. | 86 // Terminates this session and deletes itself. |
85 void Terminate(); | 87 void Terminate(); |
86 | 88 |
87 // Executes the given |script| in the context of the given frame. | 89 // Executes the given |script| in the context of the given frame. |
88 // The |script| should be in the form of a function body | 90 // The |script| should be in the form of a function body |
89 // (e.g. "return arguments[0]"), where |args| is the list of arguments to | 91 // (e.g. "return arguments[0]"), where |args| is the list of arguments to |
90 // pass to the function. The caller is responsible for the script result | 92 // pass to the function. The caller is responsible for the script result |
91 // |value|, which is set only if there is no error. | 93 // |value|, which is set only if there is no error. |
92 Error* ExecuteScript(const FrameId& frame_id, | 94 Error* ExecuteScript(const FrameId& frame_id, |
93 const std::string& script, | 95 const std::string& script, |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 Options options_; | 406 Options options_; |
405 | 407 |
406 DISALLOW_COPY_AND_ASSIGN(Session); | 408 DISALLOW_COPY_AND_ASSIGN(Session); |
407 }; | 409 }; |
408 | 410 |
409 } // namespace webdriver | 411 } // namespace webdriver |
410 | 412 |
411 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); | 413 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); |
412 | 414 |
413 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_ | 415 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_ |
OLD | NEW |