Opt front_end_server test fixtures out of package_deps validation

Change-Id: Ia0e557f4546b32390675d0addd1a2004113a1a46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404564
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
diff --git a/pkg/frontend_server/pubspec.yaml b/pkg/frontend_server/pubspec.yaml
index 6e8f1f2..75431eb 100644
--- a/pkg/frontend_server/pubspec.yaml
+++ b/pkg/frontend_server/pubspec.yaml
@@ -24,7 +24,5 @@
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependencies:
   collection: any
-  const_finder_fixtures: any
-  const_finder_fixtures_package: any
   lints: any
   test: any
diff --git a/pkg/frontend_server/test/const_finder_test.dart b/pkg/frontend_server/test/const_finder_test.dart
index eac36ab..24c87f2 100644
--- a/pkg/frontend_server/test/const_finder_test.dart
+++ b/pkg/frontend_server/test/const_finder_test.dart
@@ -142,7 +142,7 @@
     expectation['nonConstantLocations'] = <Object?>[
       <String, dynamic>{
         'file': 'file://$fixturesUrl/pkg/package.dart',
-        'line': 13,
+        'line': 17,
         'column': 25,
       },
     ];
@@ -256,27 +256,27 @@
       'nonConstantLocations': <dynamic>[
         <String, dynamic>{
           'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 13,
-          'column': 26,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 16,
-          'column': 7,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 16,
-          'column': 22,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
           'line': 17,
           'column': 26,
         },
         <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 20,
+          'column': 7,
+        },
+        <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 20,
+          'column': 22,
+        },
+        <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 21,
+          'column': 26,
+        },
+        <String, dynamic>{
           'file': 'file://$fixturesUrl/pkg/package.dart',
-          'line': 13,
+          'line': 17,
           'column': 25,
         }
       ]
@@ -343,27 +343,27 @@
       'nonConstantLocations': <dynamic>[
         <String, dynamic>{
           'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 13,
-          'column': 26,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 16,
-          'column': 7,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 16,
-          'column': 22,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
           'line': 17,
           'column': 26,
         },
         <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 20,
+          'column': 7,
+        },
+        <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 20,
+          'column': 22,
+        },
+        <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 21,
+          'column': 26,
+        },
+        <String, dynamic>{
           'file': 'file://$fixturesUrl/pkg/package.dart',
-          'line': 13,
+          'line': 17,
           'column': 25,
         }
       ],
@@ -581,4 +581,4 @@
     }
     return super.equals(e1, e2);
   }
-}
+}
\ No newline at end of file
diff --git a/pkg/frontend_server/test/fixtures/lib/consts.dart b/pkg/frontend_server/test/fixtures/lib/consts.dart
index 8bc8749..f19fb1b 100644
--- a/pkg/frontend_server/test/fixtures/lib/consts.dart
+++ b/pkg/frontend_server/test/fixtures/lib/consts.dart
@@ -2,6 +2,10 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// This test is always used with a custom package_config.json, so don't validate
+// the imports against the pubspec.yaml.
+// @skip_package_deps_validation
+
 import 'dart:core';
 
 import 'package:const_finder_fixtures_package/package.dart';
diff --git a/pkg/frontend_server/test/fixtures/lib/consts_and_non.dart b/pkg/frontend_server/test/fixtures/lib/consts_and_non.dart
index 40a6f76..96e97c1 100644
--- a/pkg/frontend_server/test/fixtures/lib/consts_and_non.dart
+++ b/pkg/frontend_server/test/fixtures/lib/consts_and_non.dart
@@ -2,6 +2,10 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// This test is always used with a custom package_config.json, so don't validate
+// the imports against the pubspec.yaml.
+// @skip_package_deps_validation
+
 import 'dart:core';
 
 import 'package:const_finder_fixtures_package/package.dart';
diff --git a/pkg/frontend_server/test/fixtures/pkg/package.dart b/pkg/frontend_server/test/fixtures/pkg/package.dart
index 124adee..1df5fab 100644
--- a/pkg/frontend_server/test/fixtures/pkg/package.dart
+++ b/pkg/frontend_server/test/fixtures/pkg/package.dart
@@ -2,6 +2,10 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
+// This test is always used with a custom package_config.json, so don't validate
+// the imports against the pubspec.yaml.
+// @skip_package_deps_validation
+
 import 'package:const_finder_fixtures/target.dart';
 
 void createTargetInPackage() {
diff --git a/tools/package_deps/bin/package_deps.dart b/tools/package_deps/bin/package_deps.dart
index e9df384..f6ebfd3 100644
--- a/tools/package_deps/bin/package_deps.dart
+++ b/tools/package_deps/bin/package_deps.dart
@@ -371,7 +371,8 @@
 
     for (var line in file.readAsLinesSync()) {
       // Check for a few tokens that should stop our parse.
-      if (line.startsWith('class ') ||
+      if (line.startsWith('// @skip_package_deps_validation') ||
+          line.startsWith('class ') ||
           line.startsWith('typedef ') ||
           line.startsWith('mixin ') ||
           line.startsWith('enum ') ||