mediaDevices.enumerateDevices() Generates Runtime Error in Browser - dart

I am attempting to capture audio from an input source via a web app in a browser using the Dart 2.7.0 SDK. I want to be able to identify the available audio sources on the system so that a user could select among them (rather than relying exclusively on the default source):
captureAudio() async{
List<MediaDeviceInfo> sources = await window.navigator.mediaDevices.enumerateDevices();
// Do more stuff here
// Note that there are numerous differences in media APIs between those listed
// for Dart and the JavaScript APIs shown on MDN. Those differences may or may not
// have any effect on this error
}
The line of code above compiles successfully but is generating an error in Chrome 79.0.3945.88 served from Webdev in Webstorm 2019.3.1 whether in debug mode or not (note: MDN shows that the corresponding JS method call should work in Chrome):
Uncaught (in promise) Error: Type 'List<dynamic>' should be 'List<MediaDeviceInfo>' to implement expected type 'FutureOr<List<MediaDeviceInfo>>'.
DartError dart_sdk.js:5172
throw_ dart_sdk.js:3880
castError dart_sdk.js:3840
cast dart_sdk.js:4159
check_FutureOr dart_sdk.js:27380
(anonymous function) dart_sdk.js:52085
Async call from Promise.then
promiseToFuture dart_sdk.js:52087
[dartx.enumerateDevices] dart_sdk.js:79203
captureAudio capturewebaudio.dart:51
runBody dart_sdk.js:32202
_async dart_sdk.js:32230
captureAudio capturewebaudio.dart:50
(anonymous function) capturewebaudio.dart:40
_checkAndCall dart_sdk.js:4084
dcall dart_sdk.js:4089
(anonymous function) dart_sdk.js:97072
Dart documentation on this topic is essentially non-existent, and given the variations in Dart and JS APIs, I'm not sure what the resolution is to this problem.

This appears to be a bug in the Dart SDK. See bug 39627 on the Dart SDK issues list. The fix is moving through the dev process.

Related

which include file has contain "wxEVT_WEBVIEW_LOADED" macro?

erlang 24.3.3 is used.
From the 24.3.3 document, the wx version is 2.1.3.
I have find 2.1.3's wx.hrl and it doesn't contain the wxEVT_WEBVIEW_LOADED and wxEVT_WEBVIEW_ERROR.
But in the doc, it says
Many of the methods in wxWebView are asynchronous, i.e. they return
immediately and perform their work in the background. This includes
functions such as loadURL/2 and reload/2. To receive notification of
the progress and completion of these functions you need to handle the
events that are provided. Specifically wxEVT_WEBVIEW_LOADED notifies
when the page or a sub-frame has finished loading and
wxEVT_WEBVIEW_ERROR notifies that an error has occurred.
My code is as follows:
Ad = wxWebView:new(Frame,?wxID_ANY,[{size,{1000,1000}}]),
lager:debug("_ad_1082:\t~p",[Ad]),
ok = wxWebView:loadURL(Ad,"http://www.baidu.com"),
wxFrame:connect(Ad, ?wxEVT_WEBVIEW_LOADED,[{callback,fun chair_launch_frame:update_webview/2},
{userData,{?CONST_FRAME_MAIN_AD_PRODUCER,Frame}}]),
wxFrame:connect(Ad, ?wxEVT_WEBVIEW_ERROR,[{callback,fun chair_launch_frame:update_webview/2},
{userData,{?CONST_FRAME_MAIN_AD_PRODUCER,Frame}}]),
The compiler give error messsage undefined macro 'wxEVT_WEBVIEW_LOADED'

Private API call not allowed in iOS (function "exc_server")

My iOS app (using the Boehm garbage collector) was rejected in the AppStore because of one private API function call. Here the offending function in file os_dep.c:
/* These are not defined in any header, although they are documented */
extern boolean_t
exc_server(mach_msg_header_t *, mach_msg_header_t *);
Here the link to the file: os_dep.c on github
I tried to comment out both the function definition and call, and the app seems running fine, but that's a really bad hack.
My question: is this function call critical? Is it really needed in iOS?
The function is only needed in the incremental GC mode which is enabled by GC_enable_incremental() call. I suspect you don't call it, so exc_server() and friends aren't called in the app.
Instead of commenting out exc_server(), I'd recommend you to pass "-D GC_DISABLE_INCREMENTAL" which removes the incremental mode support from the collector binary.

APPIUM Android: Implicit wait and explicit wait are not working

Implicit and explicit waits are not working when automating the native app. driver does not wait for the element to visible. Have already set the implicit wait of 25 seconds and also explicit wait(visibilityOf(element)) is defined before performing any action with the element.
The exception is coming as:
Returned value cannot be converted to WebElement: {stacktrace=NoSuchElementError: An element could not be located on the page using the given search parameters.
driver does not wait for the element to be visible when the navigating to the next screen and straight away throws the above exception.
NOTE: Code works fine when Thread.sleep() wait is used. But fails when Thread.sleep() is not used.
Have tried the following ways:
Defined the implicit wait and pageLoadTimeout after Android driver is
initialized with required desired capabilities and URL.
Defined implicit wait and pageLoadTimeout in the #BeforeTest method in the
TestNG test class.
You have NOT to set both waits. If you want to let your driver waits for the element to be visible, use this code during driver initialization:
driver.manage().timeouts().implicitlyWait(25, TimeUnit.SECONDS);

Ionic 5 Google Map Marker breaking animations on IOS

I'm adding google map on an ionic app using google maps javascript api 3. The map works fine but the minute i add marker on the map, the cordova animations stop working on ios, on android everything works smoothly. For example clicking on ion-select or adding Alert produces following error
Unhandled Promise rejection: – "undefined is not a function (near
'...element.animate...')" – "; Zone:" – "" – "; Task:" –
"Promise.then" – "; Value:" (2) TypeError: undefined is not a function
(near '...element.animate...') —
animation-5559213c.js:652 (anonymous function) —
animation-5559213c.js:652 forEach initializeWebAnimation —
animation-5559213c.js:651 initializeAnimation —
animation-5559213c.js:674 play — animation 5559213c.js:950 (anonymous
function) —
animation-5559213c.js:961 forEach play —
animation-5559213c.js:960 (anonymous function) —
animation-5559213c.js:852 ZoneAwarePromise — zone.js:910 playAsync —
animation-5559213c.js:850 (anonymous function) —
overlays-10cf2041.js:202 step — tslib.es6.js:99 fulfilled —
tslib.es6.js:70 run — zone.js:150 (anonymous function) — zone.js:889
runTask — zone.js:195 drainMicroTaskQueue —
zone.js:601 promiseReactionJob
My app's ionic version is 5.2.3. Any help would be appreciated.
Import the web-animations-js polyfill.
Run npm install --save web-animations-js in the terminal then uncomment the following line in src/polyfills.ts:
import 'web-animations-js';

Interactions are not available for this element in Appium

I am getting the following message while identifying element the highlighted element in “Appium”.
Appium: 1.7.1
Device: IPhone X (12.0 & Simulator)
Java client: 1.6.1
Xcode: V 10
Interactions are not available for this element.
Appium- IOS
Aim to read the content of the element using .gettext() method.
Logic used.
// Explicit wait with 30 seconds.
return driver.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(WebElement))).getText();
WebElement used.
1, /XCUIElementTypeApplication[#name=“Event Manager”]/XCUIElementTypeWindow1/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther[3]/XCUIElementTypeOther
2, //XCUIElementTypeOther[3]/XCUIElementTypeOther
None of the above return the text that are there in the image. Also no exception/error thrown as well.
Any help on what else can be done to read the web element?
I am facing the same problem where icons having some kind of call to action are not tappable when test case is executed. These are easily identified when I capture it, but if the same is tried within a script, katalon is unable to find it.

Resources