Add const_finder.dart.snapshot to the artifacts to be copied over.

Flutter has added a new utility called const finder which requires a
snapshot that matches the engine version. This is uploaded by the
engine as an artificat and we need to do the same in the HHH bot to
ensure the correct version of the snapshot is avaialable.

Change-Id: Ic5dacfc6f51a4ca7776ce5e308f92e67e6a2214b
Reviewed-on: https://dart-review.googlesource.com/c/recipes/+/147684
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
diff --git a/README.recipes.md b/README.recipes.md
index 134e977..e32e17c 100644
--- a/README.recipes.md
+++ b/README.recipes.md
@@ -129,7 +129,7 @@
 
 &mdash; **def [Build](/recipes/dart/flutter_engine.py#52)(api, checkout_dir, config, \*targets):**
 
-&mdash; **def [BuildAndTest](/recipes/dart/flutter_engine.py#341)(api, start_dir, checkout_dir, flutter_rev):**
+&mdash; **def [BuildAndTest](/recipes/dart/flutter_engine.py#342)(api, start_dir, checkout_dir, flutter_rev):**
 
 &mdash; **def [BuildLinux](/recipes/dart/flutter_engine.py#102)(api, checkout_dir):**
 
@@ -147,11 +147,11 @@
 
 &mdash; **def [RunGN](/recipes/dart/flutter_engine.py#61)(api, checkout_dir, \*args):**
 
-&mdash; **def [RunSteps](/recipes/dart/flutter_engine.py#311)(api):**
+&mdash; **def [RunSteps](/recipes/dart/flutter_engine.py#312)(api):**
 
 &mdash; **def [TestEngine](/recipes/dart/flutter_engine.py#74)(api, checkout_dir):**
 
-&mdash; **def [TestFlutter](/recipes/dart/flutter_engine.py#265)(api, start_dir, just_built_dart_sdk):**
+&mdash; **def [TestFlutter](/recipes/dart/flutter_engine.py#266)(api, start_dir, just_built_dart_sdk):**
 
 &mdash; **def [TestObservatory](/recipes/dart/flutter_engine.py#118)(api, checkout_dir):**
 
diff --git a/recipes/dart/flutter_engine.expected/flutter-engine-linux.json b/recipes/dart/flutter_engine.expected/flutter-engine-linux.json
index 1861a89..5754692 100644
--- a/recipes/dart/flutter_engine.expected/flutter-engine-linux.json
+++ b/recipes/dart/flutter_engine.expected/flutter-engine-linux.json
@@ -5296,6 +5296,51 @@
       "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
       "--json-output",
       "/path/to/tmp/json",
+      "remove",
+      "[CACHE]/builder/flutter/bin/cache/artifacts/engine/linux-x64/const_finder.dart.snapshot"
+    ],
+    "cwd": "[CACHE]/builder/flutter",
+    "env": {
+      "ANALYZER_STATE_LOCATION_OVERRIDE": "[CACHE]/builder/.dartServer",
+      "ANDROID_SDK_ROOT": "[CACHE]/builder/src/third_party/android_tools/sdk",
+      "CHROME_EXECUTABLE": "[CACHE]/builder/src/flutter/browsers/chrome/google-chrome",
+      "GOMA_DIR": "[CACHE]/goma/client",
+      "PATH": "[CACHE]/builder/src/out/host_debug/dart-sdk/bin:<PATH>",
+      "TEST_COMMIT_RANGE": "HEAD"
+    },
+    "infra_step": true,
+    "name": "remove const_finder.dart.snapshot"
+  },
+  {
+    "cmd": [
+      "vpython",
+      "-u",
+      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+      "--json-output",
+      "/path/to/tmp/json",
+      "copy",
+      "[CACHE]/builder/src/out/host_debug_unopt/gen/const_finder.dart.snapshot",
+      "[CACHE]/builder/flutter/bin/cache/artifacts/engine/linux-x64/const_finder.dart.snapshot"
+    ],
+    "cwd": "[CACHE]/builder/flutter",
+    "env": {
+      "ANALYZER_STATE_LOCATION_OVERRIDE": "[CACHE]/builder/.dartServer",
+      "ANDROID_SDK_ROOT": "[CACHE]/builder/src/third_party/android_tools/sdk",
+      "CHROME_EXECUTABLE": "[CACHE]/builder/src/flutter/browsers/chrome/google-chrome",
+      "GOMA_DIR": "[CACHE]/goma/client",
+      "PATH": "[CACHE]/builder/src/out/host_debug/dart-sdk/bin:<PATH>",
+      "TEST_COMMIT_RANGE": "HEAD"
+    },
+    "infra_step": true,
+    "name": "copy const_finder.dart.snapshot"
+  },
+  {
+    "cmd": [
+      "vpython",
+      "-u",
+      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
+      "--json-output",
+      "/path/to/tmp/json",
       "ensure-directory",
       "--mode",
       "0777",
diff --git a/recipes/dart/flutter_engine.py b/recipes/dart/flutter_engine.py
index ae67696..64f2b52 100644
--- a/recipes/dart/flutter_engine.py
+++ b/recipes/dart/flutter_engine.py
@@ -190,15 +190,16 @@
 
 def UpdateCachedEngineArtifacts(api, flutter, engine_src):
   ICU_DATA_PATH = 'third_party/icu/flutter/icudtl.dat'
-  CopyArtifacts(api, engine_src,
-    flutter.join('bin', 'cache', 'artifacts', 'engine', 'linux-x64'),
-    [ICU_DATA_PATH,
-    'out/host_debug_unopt/flutter_tester',
-    'out/host_debug_unopt/gen/flutter/lib/snapshot/isolate_snapshot.bin',
-    'out/host_debug_unopt/gen/flutter/lib/snapshot/vm_isolate_snapshot.bin',
-    'out/host_debug_unopt/gen/frontend_server.dart.snapshot',
-    ]
-  )
+  CopyArtifacts(
+      api, engine_src,
+      flutter.join('bin', 'cache', 'artifacts', 'engine', 'linux-x64'), [
+          ICU_DATA_PATH,
+          'out/host_debug_unopt/flutter_tester',
+          'out/host_debug_unopt/gen/flutter/lib/snapshot/isolate_snapshot.bin',
+          'out/host_debug_unopt/gen/flutter/lib/snapshot/vm_isolate_snapshot.bin',
+          'out/host_debug_unopt/gen/frontend_server.dart.snapshot',
+          'out/host_debug_unopt/gen/const_finder.dart.snapshot',
+      ])
 
   # Copy over new versions of gen_snapshot for profile/release arm/arm64
   for arch in ['arm', 'arm64', 'x64']: