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

Unified Diff: dart/tests/try/poi/library_updater_test.dart

Issue 789873003: Update unit tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/tests/try/poi/apply_updates_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/try/poi/library_updater_test.dart
diff --git a/dart/tests/try/poi/library_updater_test.dart b/dart/tests/try/poi/library_updater_test.dart
index e164162329f5eba61ff6ac65146878da30130a05..5d35d83730384bed4c495778baba03cb7556bf86 100644
--- a/dart/tests/try/poi/library_updater_test.dart
+++ b/dart/tests/try/poi/library_updater_test.dart
@@ -5,18 +5,27 @@
// Test of LibraryUpdater (one compilation unit per library).
library trydart.library_updater_test;
-import 'dart:convert' show
- UTF8;
-
import 'package:dart2js_incremental/library_updater.dart' show
IncrementalCompilerContext,
LibraryUpdater,
Update;
+import 'package:compiler/src/dart2jslib.dart' show
+ Script;
+
+import 'package:compiler/src/source_file.dart' show
+ StringSourceFile;
+
import 'compiler_test_case.dart';
void nolog(_) {}
+Script newScriptFrom(LibraryElement library, String newSource) {
+ Script script = library.entryCompilationUnit.script;
+ return script.copyWithFile(
+ new StringSourceFile(script.file.filename, newSource));
+}
+
class LibraryUpdaterTestCase extends CompilerTestCase {
final String newSource;
@@ -40,7 +49,8 @@ class LibraryUpdaterTestCase extends CompilerTestCase {
new LibraryUpdater(this.compiler, null, nolog, nolog, context);
context.registerUriWithUpdates([scriptUri]);
bool actualCanReuse =
- updater.canReuseLibrary(library, UTF8.encode(newSource));
+ updater.canReuseLibrary(
+ library, <Script>[newScriptFrom(library, newSource)]);
Expect.equals(expectedCanReuse, actualCanReuse);
Expect.setEquals(
« no previous file with comments | « dart/tests/try/poi/apply_updates_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698