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

Side by Side Diff: tests/compiler/dart2js/deferred_not_in_main_test.dart

Issue 1227643003: dart2js: Move most of the code_emitter_task code into the program-builder. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Upload Created 5 years, 5 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
« no previous file with comments | « tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Test of the graph segmentation algorithm used by deferred loading 5 // Test of the graph segmentation algorithm used by deferred loading
6 // to determine which elements can be deferred and which libraries 6 // to determine which elements can be deferred and which libraries
7 // much be included in the initial download (loaded eagerly). 7 // much be included in the initial download (loaded eagerly).
8 8
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import "package:async_helper/async_helper.dart"; 10 import "package:async_helper/async_helper.dart";
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement; 44 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement;
45 45
46 var mainOutputUnit = compiler.deferredLoadTask.mainOutputUnit; 46 var mainOutputUnit = compiler.deferredLoadTask.mainOutputUnit;
47 var backend = compiler.backend; 47 var backend = compiler.backend;
48 var classes = backend.emitter.neededClasses; 48 var classes = backend.emitter.neededClasses;
49 var lib1 = lookupLibrary("memory:lib1.dart"); 49 var lib1 = lookupLibrary("memory:lib1.dart");
50 var lib2 = lookupLibrary("memory:lib2.dart"); 50 var lib2 = lookupLibrary("memory:lib2.dart");
51 var foo1 = lib1.find("foo1"); 51 var foo1 = lib1.find("foo1");
52 var foo2 = lib2.find("foo2"); 52 var foo2 = lib2.find("foo2");
53 53
54 var outputClassLists = backend.emitter.outputClassLists;
55
56 Expect.notEquals(mainOutputUnit, outputUnitForElement(foo2)); 54 Expect.notEquals(mainOutputUnit, outputUnitForElement(foo2));
57 })); 55 }));
58 } 56 }
59 57
60 // lib1 imports lib2 deferred. But mainlib never uses DeferredLibrary. 58 // lib1 imports lib2 deferred. But mainlib never uses DeferredLibrary.
61 // Test that this case works. 59 // Test that this case works.
62 const Map MEMORY_SOURCE_FILES = const { 60 const Map MEMORY_SOURCE_FILES = const {
63 "main.dart":""" 61 "main.dart":"""
64 library mainlib; 62 library mainlib;
65 63
(...skipping 13 matching lines...) Expand all
79 void foo1() { 77 void foo1() {
80 lib1.loadLibrary().then((_) => lib2.foo2()); 78 lib1.loadLibrary().then((_) => lib2.foo2());
81 } 79 }
82 """, 80 """,
83 "lib2.dart":""" 81 "lib2.dart":"""
84 library lib2; 82 library lib2;
85 83
86 void foo2() {} 84 void foo2() {}
87 """, 85 """,
88 }; 86 };
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698