| OLD | NEW |
| 1 // Copyright (c) 2010 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_SESSION_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_SESSION_H_ |
| 6 #define CHROME_TEST_WEBDRIVER_SESSION_H_ | 6 #define CHROME_TEST_WEBDRIVER_SESSION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 11 #include "chrome/test/webdriver/automation.h" | 11 #include "chrome/test/webdriver/automation.h" |
| 12 #include "chrome/test/webdriver/error_codes.h" | 12 #include "chrome/test/webdriver/error_codes.h" |
| 13 | 13 |
| 14 class ListValue; |
| 15 class Value; |
| 16 |
| 14 namespace base { | 17 namespace base { |
| 15 class WaitableEvent; | 18 class WaitableEvent; |
| 16 } | 19 } |
| 17 | 20 |
| 18 namespace webdriver { | 21 namespace webdriver { |
| 19 | 22 |
| 20 // Every connection made by WebDriver maps to a session object. | 23 // Every connection made by WebDriver maps to a session object. |
| 21 // This object creates the chrome instance and keeps track of the | 24 // This object creates the chrome instance and keeps track of the |
| 22 // state necessary to control the chrome browser created. | 25 // state necessary to control the chrome browser created. |
| 23 // TODO(phajdan.jr): Abstract UITestBase classes, see: | 26 // TODO(phajdan.jr): Abstract UITestBase classes, see: |
| 24 // http://code.google.com/p/chromium/issues/detail?id=56865 | 27 // http://code.google.com/p/chromium/issues/detail?id=56865 |
| 25 class Session { | 28 class Session { |
| 26 public: | 29 public: |
| 27 explicit Session(const std::string& id); | 30 explicit Session(const std::string& id); |
| 31 ~Session(); |
| 28 | 32 |
| 29 // Creates a browser. | 33 // Creates a browser. |
| 30 bool Init(); | 34 bool Init(); |
| 31 | 35 |
| 32 // Terminates this session and disconnects its automation proxy. After | 36 // Terminates this session and disconnects its automation proxy. After |
| 33 // invoking this method, the Session can safely be deleted. | 37 // invoking this method, the Session can safely be deleted. |
| 34 void Terminate(); | 38 void Terminate(); |
| 35 | 39 |
| 36 // Executes the given |script| in the context of the frame that is currently | 40 // Executes the given |script| in the context of the frame that is currently |
| 37 // the focus of this session. The |script| should be in the form of a | 41 // the focus of this session. The |script| should be in the form of a |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 std::string current_frame_xpath_; | 102 std::string current_frame_xpath_; |
| 99 | 103 |
| 100 DISALLOW_COPY_AND_ASSIGN(Session); | 104 DISALLOW_COPY_AND_ASSIGN(Session); |
| 101 }; | 105 }; |
| 102 | 106 |
| 103 } // namespace webdriver | 107 } // namespace webdriver |
| 104 | 108 |
| 105 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); | 109 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Session); |
| 106 | 110 |
| 107 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ | 111 #endif // CHROME_TEST_WEBDRIVER_SESSION_H_ |
| OLD | NEW |