anchor.diff:          continue l;
       }
     }
  -}''');
  -    await computeAnalysisResult(source);
  -    assertErrors(source, [ResolverErrorCode.CONTINUE_LABEL_ON_SWITCH]);
  -    verify([source]);
  +}''', [ResolverErrorCode.CONTINUE_LABEL_ON_SWITCH]);
     }
   
     test_enclosingElement_invalidLocalFunction() async {
  -    String code = r'''
  +    addTestFile(r'''
   class C {
     C() {
       int get x => 0;
     }
  -}''';
  -    Source source = addSource(code);
  -
  -    TestAnalysisResult analysisResult = await computeAnalysisResult(source);
  -    assertErrors(source, [
  +}''');
  +    await resolveTestFile();
  +    assertTestErrors([
         ParserErrorCode.MISSING_FUNCTION_PARAMETERS,
         ParserErrorCode.EXPECTED_TOKEN
       ]);
   
  -    CompilationUnitElement unit = analysisResult.unit.declaredElement;
  -    LibraryElement library = unit.library;
  -    expect(library, isNotNull);
  -    expect(unit.enclosingElement, same(library));
  -
  -    var types = unit.types;
  -    expect(types, hasLength(1));
  -    var type = types[0];
  -    expect(type, isNotNull);
  -
  -    var constructors = type.constructors;
  -    expect(constructors, hasLength(1));
  -    ConstructorElement constructor = constructors[0];
  -    expect(constructor, isNotNull);
  -
  -    FunctionElement x = findElementsByName(analysisResult.unit, 'x').single;
  +    var constructor = findElement.unnamedConstructor('C');
  +    var x = findElement.localFunction('x');
       expect(x.enclosingElement, constructor);
     }
   }
  
positive.code:   }
  }
  
  /// TODO(paulberry): migrate this test away from the task model.
  /// See dartbug.com/35734.
  @reflectiveTest
  class ErrorResolverTest extends ResolverTestCase {
    test_breakLabelOnSwitchMember() async {
      Source source = addSource(r'''
  class A {
    void m(int i) {
      switch (i) {
  
negative.code: import 'package:analyzer/src/generated/source_io.dart';
  import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
  import 'package:analyzer/src/generated/testing/element_factory.dart';
  import 'package:analyzer/src/generated/testing/test_type_provider.dart';
  import 'package:analyzer/src/source/source_resource.dart';
  import 'package:analyzer/src/test_utilities/resource_provider_mixin.dart';
  import 'package:test/test.dart';
  import 'package:test_reflective_loader/test_reflective_loader.dart';
  
  import '../src/dart/resolution/driver_resolution.dart';
  import 'analysis_context_factory.dart';
  import 'parser_test.dart';
  import 'resolver_test_case.dart';
  