未验证 提交 612acf34 编写于 作者: D Dan Field 提交者: GitHub

Fix windows popup (#21522)

上级 870b093a
......@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/backtrace.h"
#include "flutter/fml/build_config.h"
#include "flutter/fml/command_line.h"
#include "flutter/fml/logging.h"
......@@ -10,6 +11,7 @@
#include "flow_test_utils.h"
int main(int argc, char** argv) {
fml::InstallCrashHandler();
testing::InitGoogleTest(&argc, argv);
fml::CommandLine cmd = fml::CommandLineFromArgcArgv(argc, argv);
......
......@@ -7,10 +7,15 @@
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
#include <signal.h>
#include <csignal>
#include <sstream>
#if OS_WIN
#include <crtdbg.h>
#include <debugapi.h>
#endif
#include "flutter/fml/logging.h"
namespace fml {
......@@ -126,6 +131,12 @@ static void ToggleSignalHandlers(bool set) {
}
void InstallCrashHandler() {
#if OS_WIN
if (!IsDebuggerPresent()) {
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
}
#endif
ToggleSignalHandlers(true);
}
......
......@@ -16,6 +16,7 @@
#include <cassert>
#include "flutter/fml/backtrace.h"
#include "flutter/fml/command_line.h"
#include "flutter/fml/icu_util.h"
#include "flutter/fml/logging.h"
......@@ -24,6 +25,7 @@
#include "txt_test_utils.h"
int main(int argc, char** argv) {
fml::InstallCrashHandler();
fml::CommandLine cmd = fml::CommandLineFromArgcArgv(argc, argv);
txt::SetCommandLine(cmd);
txt::SetFontDir(flutter::testing::GetFixturesPath());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册