mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
6884086e5c
Update to latest dwds APIs, moving back to dwds driven hot restart and enabling future work on expression evaluation.
32 lines
1.2 KiB
Dart
32 lines
1.2 KiB
Dart
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'package:flutter_tools/src/web/bootstrap.dart';
|
|
|
|
import '../../src/common.dart';
|
|
|
|
void main() {
|
|
test('generateBootstrapScript embeds urls correctly', () {
|
|
final String result = generateBootstrapScript(
|
|
requireUrl: 'require.js',
|
|
mapperUrl: 'mapper.js',
|
|
);
|
|
// require js source is interpolated correctly.
|
|
expect(result, contains('requireEl.src = "require.js";'));
|
|
// stack trace mapper source is interpolated correctly.
|
|
expect(result, contains('mapperEl.src = "mapper.js";'));
|
|
// data-main is set to correct bootstrap module.
|
|
expect(result, contains('requireEl.setAttribute("data-main", "main_module.bootstrap");'));
|
|
});
|
|
|
|
test('generateMainModule embeds urls correctly', () {
|
|
final String result = generateMainModule(
|
|
entrypoint: 'foo/bar/main.js',
|
|
);
|
|
// bootstrap main module has correct defined module.
|
|
expect(result, contains('define("main_module.bootstrap", ["foo/bar/main.js", "dart_sdk"], '
|
|
'function(app, dart_sdk) {'));
|
|
});
|
|
}
|