Unverified Commit 0d4f279f authored by Stanislav Baranov's avatar Stanislav Baranov Committed by GitHub

Read correct cached VM snapshot in dynamic mode (PRODUCT vs RELEASE) (#25472)

parent e41f1463
......@@ -359,8 +359,8 @@ class JITSnapshotter {
final Directory outputDir = fs.directory(outputPath);
outputDir.createSync(recursive: true);
final String engineVmSnapshotData = artifacts.getArtifactPath(Artifact.vmSnapshotData);
final String engineIsolateSnapshotData = artifacts.getArtifactPath(Artifact.isolateSnapshotData);
final String engineVmSnapshotData = artifacts.getArtifactPath(Artifact.vmSnapshotData, null, buildMode);
final String engineIsolateSnapshotData = artifacts.getArtifactPath(Artifact.isolateSnapshotData, null, buildMode);
final String isolateSnapshotData = fs.path.join(outputDir.path, 'isolate_snapshot_data');
final String isolateSnapshotInstructions = fs.path.join(outputDir.path, 'isolate_snapshot_instr');
......
......@@ -526,8 +526,13 @@ void main() {
snapshotter = JITSnapshotter();
mockAndroidSdk = MockAndroidSdk();
mockArtifacts = MockArtifacts();
when(mockArtifacts.getArtifactPath(Artifact.vmSnapshotData)).thenReturn(kEngineVmSnapshotData);
when(mockArtifacts.getArtifactPath(Artifact.isolateSnapshotData)).thenReturn(kEngineIsolateSnapshotData);
for (BuildMode mode in BuildMode.values) {
when(mockArtifacts.getArtifactPath(Artifact.vmSnapshotData, null, mode))
.thenReturn(kEngineVmSnapshotData);
when(mockArtifacts.getArtifactPath(Artifact.isolateSnapshotData, null, mode))
.thenReturn(kEngineIsolateSnapshotData);
}
});
final Map<Type, Generator> contextOverrides = <Type, Generator>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment