Skip to content

Commit 8bbedd4

Browse files
authored
Fix default custom html handler (#809)
1 parent 0ff3bf1 commit 8bbedd4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
## 0.12.34+1
22

33
* Fixed an issue `--precompiled` node tests in subdirectories.
4+
* Fixed default custom html handler so it correctly includes the
5+
packages/test/dart.js file. This allows you to get proper errors instead of
6+
timeouts if there are load exceptions in the browser.
47

58
## 0.12.34
69

lib/src/runner/browser/platform.dart

+4-6
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,16 @@ class BrowserPlatform extends PlatformPlugin
177177

178178
// Link to the Dart wrapper on Dartium and the compiled JS version
179179
// elsewhere.
180-
var scriptBase =
181-
"${HTML_ESCAPE.convert(p.basename(test))}.browser_test.dart";
182-
var script = request.headers['user-agent'].contains('(Dart)')
183-
? 'type="application/dart" src="$scriptBase"'
184-
: 'src="$scriptBase.js"';
180+
var scriptBase = HTML_ESCAPE.convert(p.basename(test));
181+
var link = '<link rel="x-dart-test" href="$scriptBase">';
185182

186183
return new shelf.Response.ok('''
187184
<!DOCTYPE html>
188185
<html>
189186
<head>
190187
<title>${HTML_ESCAPE.convert(test)} Test</title>
191-
<script $script></script>
188+
$link
189+
<script src="packages/test/dart.js"></script>
192190
</head>
193191
</html>
194192
''', headers: {'Content-Type': 'text/html'});

0 commit comments

Comments
 (0)