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

Unified Diff: tests/compiler/dart2js/patch_test.dart

Issue 2836733002: dart2js: patch file support cleanup (Closed)
Patch Set: remove js_array change Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/patch_test.dart
diff --git a/tests/compiler/dart2js/patch_test.dart b/tests/compiler/dart2js/patch_test.dart
index 3ca88c3877cb31eab66474ff393b954b8a0263b7..01785aee2bb75c1de916ec84f74446b1f72a7b51 100644
--- a/tests/compiler/dart2js/patch_test.dart
+++ b/tests/compiler/dart2js/patch_test.dart
@@ -22,14 +22,10 @@ Future<Compiler> applyPatch(String script, String patch,
{bool analyzeAll: false,
bool analyzeOnly: false,
bool runCompiler: false,
- String main: "",
- String patchVersion}) async {
+ String main: ""}) async {
Map<String, String> core = <String, String>{'script': script};
MockCompiler compiler = new MockCompiler.internal(
- coreSource: core,
- analyzeAll: analyzeAll,
- analyzeOnly: analyzeOnly,
- patchVersion: patchVersion);
+ coreSource: core, analyzeAll: analyzeAll, analyzeOnly: analyzeOnly);
compiler.diagnosticHandler = createHandler(compiler, '');
var uri = Uri.parse("patch:core");
compiler.registerSource(uri, "$DEFAULT_PATCH_CORE_SOURCE\n$patch");
@@ -218,72 +214,6 @@ Future testPatchFunctionGenericDifferentNames() async {
MessageKind.PATCH_TYPE_VARIABLES_MISMATCH);
}
-Future testPatchVersioned() async {
- String fullPatch = "test(){return 'string';}";
- String lazyPatch = "test(){return 'new and improved string';}";
-
- String patchSource = """
- @patch_full $fullPatch
- @patch_lazy $lazyPatch
- """;
-
- Future test(String patchVersion,
- {String patchText,
- bool expectIsPatched: true,
- String expectedError,
- String defaultPatch: '',
- String expectedInternalError}) async {
- return applyPatch(
- "external test();",
- """
- $defaultPatch
- $patchSource
- """,
- patchVersion: patchVersion).then((compiler) {
- Element origin = ensure(
- compiler, "test", compiler.commonElements.coreLibrary.find,
- expectIsPatched: expectIsPatched, checkHasBody: true);
- if (expectIsPatched) {
- AstElement patch = ensure(
- compiler, "test", compiler.commonElements.coreLibrary.patch.find,
- expectIsPatch: true, checkHasBody: true);
- Expect.equals(origin.patch, patch);
- Expect.equals(patch.origin, origin);
- Expect.equals(patchText, patch.node.toString());
- }
-
- compiler.resolution.computeWorldImpact(origin);
- compiler.enqueuer.resolution.emptyDeferredQueueForTesting();
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(collector.warnings.isEmpty,
- "Unexpected warnings: ${collector.warnings}");
- if (expectedError != null) {
- Expect.equals(expectedError, collector.errors.first.message.toString());
- } else {
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
- }
- }).catchError((error) {
- if (expectedInternalError != null) {
- Expect.equals(
- 'Internal Error: $expectedInternalError', error.toString());
- } else {
- throw error;
- }
- });
- }
-
- await test('full', patchText: fullPatch);
- await test('lazy', patchText: lazyPatch);
- await test('unknown',
- expectIsPatched: false,
- expectedError: 'External method without an implementation.');
- await test('full',
- defaultPatch: "@patch test(){}",
- expectedInternalError: "Trying to patch a function more than once.");
-}
-
Future testPatchConstructor() async {
var compiler = await applyPatch(
"""
@@ -1151,8 +1081,6 @@ main() {
await testInjectedPublicFunction();
await testPatchSignatureCheck();
- await testPatchVersioned();
-
await testExternalWithoutImplementationTopLevel();
await testExternalWithoutImplementationMember();
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698