| 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_AUTOMATION_H_ | 5 #ifndef CHROME_TEST_WEBDRIVER_AUTOMATION_H_ |
| 6 #define CHROME_TEST_WEBDRIVER_AUTOMATION_H_ | 6 #define CHROME_TEST_WEBDRIVER_AUTOMATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "base/scoped_temp_dir.h" | 12 #include "base/scoped_temp_dir.h" |
| 13 #include "chrome/test/automation/browser_proxy.h" | |
| 14 #include "chrome/test/automation/tab_proxy.h" | |
| 15 #include "chrome/test/ui/ui_test.h" | 13 #include "chrome/test/ui/ui_test.h" |
| 16 | 14 |
| 17 namespace webdriver { | 15 namespace webdriver { |
| 18 | 16 |
| 19 // Creates and controls the Chrome instance. | 17 // Creates and controls the Chrome instance. |
| 20 // This class should be created and accessed on a single thread. | 18 // This class should be created and accessed on a single thread. |
| 21 // TODO(phajdan.jr): Abstract UITestBase classes, see: | 19 // TODO(phajdan.jr): Abstract UITestBase classes, see: |
| 22 // http://code.google.com/p/chromium/issues/detail?id=56865 | 20 // http://code.google.com/p/chromium/issues/detail?id=56865 |
| 23 class Automation : private UITestBase { | 21 class Automation : private UITestBase { |
| 24 public: | 22 public: |
| 25 Automation() {} | 23 Automation(); |
| 24 virtual ~Automation(); |
| 26 | 25 |
| 27 // Creates a browser. | 26 // Creates a browser. |
| 28 void Init(bool* success); | 27 void Init(bool* success); |
| 29 | 28 |
| 30 // Terminates this session and disconnects its automation proxy. After | 29 // Terminates this session and disconnects its automation proxy. After |
| 31 // invoking this method, the Automation can safely be deleted. | 30 // invoking this method, the Automation can safely be deleted. |
| 32 void Terminate(); | 31 void Terminate(); |
| 33 | 32 |
| 34 // Executes the given |script| in the specified frame of the current | 33 // Executes the given |script| in the specified frame of the current |
| 35 // tab. |result| will be set to the JSON result. Returns true on success. | 34 // tab. |result| will be set to the JSON result. Returns true on success. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 52 ScopedTempDir profile_dir_; | 51 ScopedTempDir profile_dir_; |
| 53 | 52 |
| 54 DISALLOW_COPY_AND_ASSIGN(Automation); | 53 DISALLOW_COPY_AND_ASSIGN(Automation); |
| 55 }; | 54 }; |
| 56 | 55 |
| 57 } // namespace webdriver | 56 } // namespace webdriver |
| 58 | 57 |
| 59 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Automation); | 58 DISABLE_RUNNABLE_METHOD_REFCOUNT(webdriver::Automation); |
| 60 | 59 |
| 61 #endif // CHROME_TEST_WEBDRIVER_AUTOMATION_H_ | 60 #endif // CHROME_TEST_WEBDRIVER_AUTOMATION_H_ |
| OLD | NEW |