| 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_CHROMEDRIVER_SESSION_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_SESSION_H_ |
| 6 #define CHROME_TEST_CHROMEDRIVER_SESSION_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_SESSION_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/files/scoped_temp_dir.h" | |
| 14 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 15 #include "chrome/test/chromedriver/basic_types.h" | 14 #include "chrome/test/chromedriver/basic_types.h" |
| 16 #include "chrome/test/chromedriver/chrome/device_metrics.h" | 15 #include "chrome/test/chromedriver/chrome/device_metrics.h" |
| 17 #include "chrome/test/chromedriver/chrome/geoposition.h" | 16 #include "chrome/test/chromedriver/chrome/geoposition.h" |
| 18 #include "chrome/test/chromedriver/chrome/network_conditions.h" | 17 #include "chrome/test/chromedriver/chrome/network_conditions.h" |
| 18 #include "chrome/test/chromedriver/chrome/scoped_temp_dir_with_retry.h" |
| 19 #include "chrome/test/chromedriver/command_listener.h" | 19 #include "chrome/test/chromedriver/command_listener.h" |
| 20 | 20 |
| 21 static const char kAccept[] = "accept"; | 21 static const char kAccept[] = "accept"; |
| 22 static const char kDismiss[] = "dismiss"; | 22 static const char kDismiss[] = "dismiss"; |
| 23 static const char kIgnore[] = "ignore"; | 23 static const char kIgnore[] = "ignore"; |
| 24 | 24 |
| 25 namespace base { | 25 namespace base { |
| 26 class DictionaryValue; | 26 class DictionaryValue; |
| 27 } | 27 } |
| 28 | 28 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 base::TimeDelta page_load_timeout; | 75 base::TimeDelta page_load_timeout; |
| 76 base::TimeDelta script_timeout; | 76 base::TimeDelta script_timeout; |
| 77 std::unique_ptr<std::string> prompt_text; | 77 std::unique_ptr<std::string> prompt_text; |
| 78 std::unique_ptr<Geoposition> overridden_geoposition; | 78 std::unique_ptr<Geoposition> overridden_geoposition; |
| 79 std::unique_ptr<DeviceMetrics> overridden_device_metrics; | 79 std::unique_ptr<DeviceMetrics> overridden_device_metrics; |
| 80 std::unique_ptr<NetworkConditions> overridden_network_conditions; | 80 std::unique_ptr<NetworkConditions> overridden_network_conditions; |
| 81 std::string orientation_type; | 81 std::string orientation_type; |
| 82 // Logs that populate from DevTools events. | 82 // Logs that populate from DevTools events. |
| 83 std::vector<std::unique_ptr<WebDriverLog>> devtools_logs; | 83 std::vector<std::unique_ptr<WebDriverLog>> devtools_logs; |
| 84 std::unique_ptr<WebDriverLog> driver_log; | 84 std::unique_ptr<WebDriverLog> driver_log; |
| 85 base::ScopedTempDir temp_dir; | 85 ScopedTempDirWithRetry temp_dir; |
| 86 std::unique_ptr<base::DictionaryValue> capabilities; | 86 std::unique_ptr<base::DictionaryValue> capabilities; |
| 87 bool auto_reporting_enabled; | 87 bool auto_reporting_enabled; |
| 88 // |command_listeners| should be declared after |chrome|. When the |Session| | 88 // |command_listeners| should be declared after |chrome|. When the |Session| |
| 89 // is destroyed, |command_listeners| should be freed first, since some | 89 // is destroyed, |command_listeners| should be freed first, since some |
| 90 // |CommandListener|s might be |CommandListenerProxy|s that forward to | 90 // |CommandListener|s might be |CommandListenerProxy|s that forward to |
| 91 // |DevToolsEventListener|s owned by |chrome|. | 91 // |DevToolsEventListener|s owned by |chrome|. |
| 92 std::vector<std::unique_ptr<CommandListener>> command_listeners; | 92 std::vector<std::unique_ptr<CommandListener>> command_listeners; |
| 93 std::string unexpected_alert_behaviour; | 93 std::string unexpected_alert_behaviour; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 Session* GetThreadLocalSession(); | 96 Session* GetThreadLocalSession(); |
| 97 | 97 |
| 98 void SetThreadLocalSession(std::unique_ptr<Session> session); | 98 void SetThreadLocalSession(std::unique_ptr<Session> session); |
| 99 | 99 |
| 100 #endif // CHROME_TEST_CHROMEDRIVER_SESSION_H_ | 100 #endif // CHROME_TEST_CHROMEDRIVER_SESSION_H_ |
| OLD | NEW |