| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,52 +27,66 @@ def __init__(self, browser_context: "BrowserContext") -> None: | |||
| 27 | 27 | ||
| 28 | 28 | async def install(self, time: Union[float, str, datetime.datetime] = None) -> None: | |
| 29 | 29 | await self._browser_context._channel.send( | |
| 30 | - "clockInstall", None, parse_time(time) if time is not None else {} | ||
| 30 | + "clockInstall", | ||
| 31 | + self._browser_context._timeout_settings.timeout, | ||
| 32 | + parse_time(time) if time is not None else {}, | ||
| 31 | 33 | ) | |
| 32 | 34 | ||
| 33 | 35 | async def fast_forward( | |
| 34 | 36 | self, | |
| 35 | 37 | ticks: Union[int, str], | |
| 36 | 38 | ) -> None: | |
| 37 | 39 | await self._browser_context._channel.send( | |
| 38 | - "clockFastForward", None, parse_ticks(ticks) | ||
| 40 | + "clockFastForward", | ||
| 41 | + self._browser_context._timeout_settings.timeout, | ||
| 42 | + parse_ticks(ticks), | ||
| 39 | 43 | ) | |
| 40 | 44 | ||
| 41 | 45 | async def pause_at( | |
| 42 | 46 | self, | |
| 43 | 47 | time: Union[float, str, datetime.datetime], | |
| 44 | 48 | ) -> None: | |
| 45 | 49 | await self._browser_context._channel.send( | |
| 46 | - "clockPauseAt", None, parse_time(time) | ||
| 50 | + "clockPauseAt", | ||
| 51 | + self._browser_context._timeout_settings.timeout, | ||
| 52 | + parse_time(time), | ||
| 47 | 53 | ) | |
| 48 | 54 | ||
| 49 | 55 | async def resume( | |
| 50 | 56 | self, | |
| 51 | 57 | ) -> None: | |
| 52 | - await self._browser_context._channel.send("clockResume", None) | ||
| 58 | + await self._browser_context._channel.send( | ||
| 59 | + "clockResume", self._browser_context._timeout_settings.timeout | ||
| 60 | + ) | ||
| 53 | 61 | ||
| 54 | 62 | async def run_for( | |
| 55 | 63 | self, | |
| 56 | 64 | ticks: Union[int, str], | |
| 57 | 65 | ) -> None: | |
| 58 | 66 | await self._browser_context._channel.send( | |
| 59 | - "clockRunFor", None, parse_ticks(ticks) | ||
| 67 | + "clockRunFor", | ||
| 68 | + self._browser_context._timeout_settings.timeout, | ||
| 69 | + parse_ticks(ticks), | ||
| 60 | 70 | ) | |
| 61 | 71 | ||
| 62 | 72 | async def set_fixed_time( | |
| 63 | 73 | self, | |
| 64 | 74 | time: Union[float, str, datetime.datetime], | |
| 65 | 75 | ) -> None: | |
| 66 | 76 | await self._browser_context._channel.send( | |
| 67 | - "clockSetFixedTime", None, parse_time(time) | ||
| 77 | + "clockSetFixedTime", | ||
| 78 | + self._browser_context._timeout_settings.timeout, | ||
| 79 | + parse_time(time), | ||
| 68 | 80 | ) | |
| 69 | 81 | ||
| 70 | 82 | async def set_system_time( | |
| 71 | 83 | self, | |
| 72 | 84 | time: Union[float, str, datetime.datetime], | |
| 73 | 85 | ) -> None: | |
| 74 | 86 | await self._browser_context._channel.send( | |
| 75 | - "clockSetSystemTime", None, parse_time(time) | ||
| 87 | + "clockSetSystemTime", | ||
| 88 | + self._browser_context._timeout_settings.timeout, | ||
| 89 | + parse_time(time), | ||
| 76 | 90 | ) | |
| 77 | 91 | ||
| 78 | 92 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -648,7 +648,7 @@ def _augment_params( | |||
| 648 | 648 | ) -> Dict: | |
| 649 | 649 | if params is None: | |
| 650 | 650 | params = {} | |
| 651 | - if timeout_calculator is not None: | ||
| 651 | + if timeout_calculator: | ||
| 652 | 652 | params["timeout"] = timeout_calculator(params.get("timeout")) | |
| 653 | 653 | return _filter_none(params) | |
| 654 | 654 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -383,7 +383,7 @@ async def focus(self, timeout: float = None) -> None: | |||
| 383 | 383 | async def blur(self, timeout: float = None) -> None: | |
| 384 | 384 | await self._frame._channel.send( | |
| 385 | 385 | "blur", | |
| 386 | - None, | ||
| 386 | + self._frame._timeout, | ||
| 387 | 387 | { | |
| 388 | 388 | "selector": self._selector, | |
| 389 | 389 | "strict": True, | |
@@ -550,7 +550,7 @@ async def screenshot( | |||
| 550 | 550 | async def aria_snapshot(self, timeout: float = None) -> str: | |
| 551 | 551 | return await self._frame._channel.send( | |
| 552 | 552 | "ariaSnapshot", | |
| 553 | - None, | ||
| 553 | + self._frame._timeout, | ||
| 554 | 554 | { | |
| 555 | 555 | "selector": self._selector, | |
| 556 | 556 | **locals_to_params(locals()), | |
@@ -728,7 +728,7 @@ async def _expect( | |||
| 728 | 728 | options["expectedValue"] = serialize_argument(options["expectedValue"]) | |
| 729 | 729 | result = await self._frame._channel.send_return_as_dict( | |
| 730 | 730 | "expect", | |
| 731 | - None, | ||
| 731 | + self._frame._timeout, | ||
| 732 | 732 | { | |
| 733 | 733 | "selector": self._selector, | |
| 734 | 734 | "expression": expression, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,7 +46,9 @@ async def register( | |||
| 46 | 46 | engine["contentScript"] = contentScript | |
| 47 | 47 | for context in self._contexts_for_selectors: | |
| 48 | 48 | await context._channel.send( | |
| 49 | - "registerSelectorEngine", None, {"selectorEngine": engine} | ||
| 49 | + "registerSelectorEngine", | ||
| 50 | + context._timeout_settings.timeout, | ||
| 51 | + {"selectorEngine": engine}, | ||
| 50 | 52 | ) | |
| 51 | 53 | self._selector_engines.append(engine) | |
| 52 | 54 | ||
@@ -55,5 +57,7 @@ def set_test_id_attribute(self, attributeName: str) -> None: | |||
| 55 | 57 | self._test_id_attribute_name = attributeName | |
| 56 | 58 | for context in self._contexts_for_selectors: | |
| 57 | 59 | context._channel.send_no_reply( | |
| 58 | - "setTestIdAttributeName", None, {"testIdAttributeName": attributeName} | ||
| 60 | + "setTestIdAttributeName", | ||
| 61 | + context._timeout_settings.timeout, | ||
| 62 | + {"testIdAttributeName": attributeName}, | ||
| 59 | 63 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,7 +84,7 @@ async def convert_input_files( | |||
| 84 | 84 | result = await context._connection.wrap_api_call( | |
| 85 | 85 | lambda: context._channel.send_return_as_dict( | |
| 86 | 86 | "createTempFiles", | |
| 87 | - None, | ||
| 87 | + context._timeout_settings.timeout, | ||
| 88 | 88 | { | |
| 89 | 89 | "rootDirName": ( | |
| 90 | 90 | os.path.basename(local_directory) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments