OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/scoped_temp_dir.h" |
15 #include "base/string16.h" | 16 #include "base/string16.h" |
16 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
17 #include "chrome/common/automation_constants.h" | 18 #include "chrome/common/automation_constants.h" |
18 #include "chrome/test/automation/automation_json_requests.h" | 19 #include "chrome/test/automation/automation_json_requests.h" |
19 #include "chrome/test/webdriver/frame_path.h" | 20 #include "chrome/test/webdriver/frame_path.h" |
20 #include "chrome/test/webdriver/webdriver_automation.h" | 21 #include "chrome/test/webdriver/webdriver_automation.h" |
21 #include "chrome/test/webdriver/webdriver_basic_types.h" | 22 #include "chrome/test/webdriver/webdriver_basic_types.h" |
22 #include "chrome/test/webdriver/webdriver_capabilities_parser.h" | 23 #include "chrome/test/webdriver/webdriver_capabilities_parser.h" |
23 #include "chrome/test/webdriver/webdriver_element_id.h" | 24 #include "chrome/test/webdriver/webdriver_element_id.h" |
24 #include "chrome/test/webdriver/webdriver_logging.h" | 25 #include "chrome/test/webdriver/webdriver_logging.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 void set_async_script_timeout(int timeout_ms); | 377 void set_async_script_timeout(int timeout_ms); |
377 int async_script_timeout() const; | 378 int async_script_timeout() const; |
378 | 379 |
379 void set_implicit_wait(int timeout_ms); | 380 void set_implicit_wait(int timeout_ms); |
380 int implicit_wait() const; | 381 int implicit_wait() const; |
381 | 382 |
382 const Point& get_mouse_position() const; | 383 const Point& get_mouse_position() const; |
383 | 384 |
384 const Logger& logger() const; | 385 const Logger& logger() const; |
385 | 386 |
| 387 const FilePath& temp_dir() const; |
| 388 |
386 const Capabilities& capabilities() const; | 389 const Capabilities& capabilities() const; |
387 | 390 |
388 private: | 391 private: |
389 void RunSessionTask(const base::Closure& task); | 392 void RunSessionTask(const base::Closure& task); |
390 void RunClosureOnSessionThread( | 393 void RunClosureOnSessionThread( |
391 const base::Closure& task, | 394 const base::Closure& task, |
392 base::WaitableEvent* done_event); | 395 base::WaitableEvent* done_event); |
393 void InitOnSessionThread(const Automation::BrowserOptions& options, | 396 void InitOnSessionThread(const Automation::BrowserOptions& options, |
394 int* build_no, | 397 int* build_no, |
395 Error** error); | 398 Error** error); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 Point mouse_position_; | 466 Point mouse_position_; |
464 | 467 |
465 // Chrome does not have an individual method for setting the prompt text | 468 // Chrome does not have an individual method for setting the prompt text |
466 // of an alert. Instead, when the WebDriver client wants to set the text, | 469 // of an alert. Instead, when the WebDriver client wants to set the text, |
467 // we store it here and pass the text when the alert is accepted or | 470 // we store it here and pass the text when the alert is accepted or |
468 // dismissed. This text should only be used if |has_alert_prompt_text_| | 471 // dismissed. This text should only be used if |has_alert_prompt_text_| |
469 // is true, so that the default prompt text is not overridden. | 472 // is true, so that the default prompt text is not overridden. |
470 std::string alert_prompt_text_; | 473 std::string alert_prompt_text_; |
471 bool has_alert_prompt_text_; | 474 bool has_alert_prompt_text_; |
472 | 475 |
| 476 // Temporary directory containing session data. |
| 477 ScopedTempDir temp_dir_; |
473 Capabilities capabilities_; | 478 Capabilities capabilities_; |
474 | 479 |
475 // Current state of all modifier keys. | 480 // Current state of all modifier keys. |
476 int sticky_modifiers_; | 481 int sticky_modifiers_; |
477 | 482 |
478 // Chrome's build number. This is the 3rd number in Chrome's version string | 483 // Chrome's build number. This is the 3rd number in Chrome's version string |
479 // (e.g., 18.0.995.0 -> 995). Only valid after Chrome has started. | 484 // (e.g., 18.0.995.0 -> 995). Only valid after Chrome has started. |
480 // See http://dev.chromium.org/releases/version-numbers. | 485 // See http://dev.chromium.org/releases/version-numbers. |
481 int build_no_; | 486 int build_no_; |
482 | 487 |
483 DISALLOW_COPY_AND_ASSIGN(Session); | 488 DISALLOW_COPY_AND_ASSIGN(Session); |
484 }; | 489 }; |
485 | 490 |
486 } // namespace webdriver | 491 } // namespace webdriver |
487 | 492 |
488 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_ | 493 #endif // CHROME_TEST_WEBDRIVER_WEBDRIVER_SESSION_H_ |
OLD | NEW |