gpt4 book ai didi

testing - Dartium/content shell 无法运行测试

转载 作者:行者123 更新时间:2023-11-28 20:28:49 25 4
gpt4 key购买 nike

运行测试时用

pub run test -p dartium (or content-shell)

尽管浏览器以空白页面打开,但每个测试都失败并输出相同的内容:enter image description here

browser.dart 文件是临时制作的:

@TestOn("browser")
import "package:test/test.dart";
import "dart:html";
void main(){
test("it works!", (){
expect(true, isTrue);
});
}

我什至尝试添加一个 browser.html 文件:

<!doctype html>
<html>
<head>
<title>Browser test</title>
<link rel="x-dart-test" href="browser.dart">
<script src="packages/test/dart.js"></script>
</head>
<body>
<h1>It works</h1>
</body>
</html>

仍然因同样的错误而失败 >.<

最佳答案

Content shell 由测试包使用 --dump-render-tree [custom_ad_hoc_url] 选项执行,最终导致错误,至少在我的系统中(我认为与字体有关) )

我所做的解决方法是制作一个省略第一个选项的可执行文件,如下所示:

#!/bin/bash
#/usr/bin/content_shell
/path/to/content-shell-dir $2

关于testing - Dartium/content shell 无法运行测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39681783/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com