Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Side by Side Diff: tests/compiler/dart2js_extra/deferred_custom_loader_test.dart

Issue 1653453002: Don't use "var" to introduce the deferred_initializer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add test. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'package:async_helper/async_helper.dart';
6 import 'package:expect/expect.dart';
7
8 import 'deferred_custom_loader_lib.dart' deferred as def;
9
10 void setup() native """
11 // In d8 we don't have any way to load the content of the file, so just use
12 // the preamble's loader.
13 if (!self.dartDeferredLibraryLoader) {
14 self.dartDeferredLibraryLoader = function(uri, success, error) {
15 var req = new XMLHttpRequest();
16 req.addEventListener("load", function() {
17 eval(this.responseText);
18 success();
19 });
20 req.open("GET", uri);
21 req.send();
22 };
23 }
24 """;
25
26
27 runTest() async {
28 setup();
29 await def.loadLibrary();
30 Expect.equals(499, def.foo());
31 }
32
33 main() {
34 asyncStart();
35 runTest().then((_) => asyncEnd());
36 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/deferred_custom_loader_lib.dart ('k') | tests/language/deferred_type_dependency_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698