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

Side by Side Diff: tests/language/deferred_shadow_load_library_test.dart

Issue 201613006: Introduces the new syntax for deferred loading (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Ambigous elements are not top-level. Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:async";
6 import 'package:expect/expect.dart';
5 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
6 import 'package:expect/expect.dart';
7 8
8 import 'dart:async'; 9 // This library contains a member loadLibrary.
10 // Check that we shadow this member.
11 import "deferred_shadow_load_library_lib.dart" deferred as lib;
9 12
10 @lazy import 'deferred_class_library2.dart' as lib; 13 void main() {
11 14 var x = lib.loadLibrary();
12 const lazy = const DeferredLibrary('deferred_class_library2'); 15 Expect.isTrue(x is Future);
13
14 main() {
15 asyncStart(); 16 asyncStart();
16 lazy.load().then((bool didLoad) { 17 x.then((_) {
17 Expect.isTrue(didLoad); 18 Expect.isTrue(lib.trueVar);
floitsch 2014/03/19 21:04:51 check that loadLibrary is still shadowed once the
sigurdm 2014/03/20 12:26:33 Done.
18 Expect.equals(499, lib.C1.value);
19 asyncEnd(); 19 asyncEnd();
20 }); 20 });
21 } 21 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698