Return a failure exit code in flutter_tester if an uncaught error occurs in a microtask (flutter/engine#5736)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "flutter/fml/message_loop.h"
|
||||
#include "flutter/lib/ui/window/window.h"
|
||||
#include "lib/tonic/converter/dart_converter.h"
|
||||
#include "lib/tonic/dart_message_handler.h"
|
||||
|
||||
using tonic::ToDart;
|
||||
|
||||
@@ -106,4 +107,12 @@ IsolateNameServer* UIDartState::GetIsolateNameServer() {
|
||||
return isolate_name_server_;
|
||||
}
|
||||
|
||||
tonic::DartErrorHandleType UIDartState::GetLastError() {
|
||||
tonic::DartErrorHandleType error = message_handler().isolate_last_error();
|
||||
if (error == tonic::kNoError) {
|
||||
error = microtask_queue_.GetLastError();
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -49,6 +49,8 @@ class UIDartState : public tonic::DartState {
|
||||
|
||||
IsolateNameServer* GetIsolateNameServer();
|
||||
|
||||
tonic::DartErrorHandleType GetLastError();
|
||||
|
||||
template <class T>
|
||||
static flow::SkiaGPUObject<T> CreateGPUObject(sk_sp<T> object) {
|
||||
if (!object) {
|
||||
|
||||
@@ -270,8 +270,7 @@ bool RuntimeController::HasLivePorts() {
|
||||
}
|
||||
|
||||
tonic::DartErrorHandleType RuntimeController::GetLastError() {
|
||||
return root_isolate_ ? root_isolate_->message_handler().isolate_last_error()
|
||||
: tonic::kNoError;
|
||||
return root_isolate_ ? root_isolate_->GetLastError() : tonic::kNoError;
|
||||
}
|
||||
|
||||
fml::WeakPtr<DartIsolate> RuntimeController::GetRootIsolate() {
|
||||
|
||||
Reference in New Issue
Block a user