2
2
3
3
from .base import Browser , ExecutorBrowser , require_arg
4
4
from .base import get_timeout_multiplier # noqa: F401
5
+ from .chrome import executor_kwargs as chrome_executor_kwargs
5
6
from ..webdriver_server import ChromeDriverServer
6
- from ..executors import executor_kwargs as base_executor_kwargs
7
- from ..executors .executorselenium import (SeleniumTestharnessExecutor , # noqa: F401
8
- SeleniumRefTestExecutor ) # noqa: F401
7
+ from ..executors .executorwebdriver import (WebDriverTestharnessExecutor , # noqa: F401
8
+ WebDriverRefTestExecutor ) # noqa: F401
9
9
from ..executors .executorchrome import ChromeDriverWdspecExecutor # noqa: F401
10
10
11
11
12
12
__wptrunner__ = {"product" : "chrome_android" ,
13
13
"check_args" : "check_args" ,
14
14
"browser" : "ChromeAndroidBrowser" ,
15
- "executor" : {"testharness" : "SeleniumTestharnessExecutor " ,
16
- "reftest" : "SeleniumRefTestExecutor " ,
15
+ "executor" : {"testharness" : "WebDriverTestharnessExecutor " ,
16
+ "reftest" : "WebDriverRefTestExecutor " ,
17
17
"wdspec" : "ChromeDriverWdspecExecutor" },
18
18
"browser_kwargs" : "browser_kwargs" ,
19
19
"executor_kwargs" : "executor_kwargs" ,
@@ -36,31 +36,25 @@ def browser_kwargs(test_type, run_info_data, config, **kwargs):
36
36
37
37
def executor_kwargs (test_type , server_config , cache_manager , run_info_data ,
38
38
** kwargs ):
39
- from selenium .webdriver import DesiredCapabilities
40
-
41
- # Use extend() to modify the global list in place.
39
+ # Use update() to modify the global list in place.
42
40
_wptserve_ports .update (set (
43
41
server_config ['ports' ]['http' ] + server_config ['ports' ]['https' ] +
44
42
server_config ['ports' ]['ws' ] + server_config ['ports' ]['wss' ]
45
43
))
46
44
47
- executor_kwargs = base_executor_kwargs (test_type , server_config , cache_manager , run_info_data ,
48
- ** kwargs )
49
- executor_kwargs ["close_after_done" ] = True
50
- capabilities = dict (DesiredCapabilities .CHROME .items ())
51
- capabilities ["goog:chromeOptions" ] = {}
52
- # TODO(chrome): browser_channel should be properly supported.
45
+ executor_kwargs = chrome_executor_kwargs (test_type , server_config ,
46
+ cache_manager , run_info_data ,
47
+ ** kwargs )
48
+ del executor_kwargs ["capabilities" ]["goog:chromeOptions" ]["prefs" ]
49
+ del executor_kwargs ["capabilities" ]["goog:chromeOptions" ]["useAutomationExtension" ]
50
+
51
+ # TODO(Hexcles): browser_channel should be properly supported.
53
52
package_name = "com.android.chrome" # stable channel
54
53
# Required to start on mobile
55
- capabilities ["goog:chromeOptions" ]["androidPackage" ] = package_name
56
-
57
- for (kwarg , capability ) in [("binary" , "binary" ), ("binary_args" , "args" )]:
58
- if kwargs [kwarg ] is not None :
59
- capabilities ["goog:chromeOptions" ][capability ] = kwargs [kwarg ]
60
- if test_type == "testharness" :
61
- capabilities ["useAutomationExtension" ] = False
62
- capabilities ["excludeSwitches" ] = ["enable-automation" ]
63
- executor_kwargs ["capabilities" ] = capabilities
54
+ executor_kwargs ["capabilities" ]["goog:chromeOptions" ]["androidPackage" ] = \
55
+ package_name
56
+ # Map wptrunner args to chromeOptions.
57
+
64
58
return executor_kwargs
65
59
66
60
0 commit comments