Unverified Commit 42389741 authored by Andrew Kolos's avatar Andrew Kolos Committed by GitHub

update asset manifest file name referenced in `WebServiceWorker` (#135954)

Closes https://github.com/flutter/flutter/issues/130455.

Updates the name `WebServiceWorker` uses to reference the asset manifest file to the name of the new file generated since   https://github.com/flutter/flutter/pull/131382. This will make Flutter web apps correctly prefetch the asset manifest file.
parent 1328997b
......@@ -311,7 +311,7 @@ Future<void> runWebServiceWorkerTest({
'main.dart.js': 1,
'flutter_service_worker.js': 1,
'assets/FontManifest.json': 1,
'assets/AssetManifest.json': 1,
'assets/AssetManifest.bin.json': 1,
'assets/fonts/MaterialIcons-Regular.otf': 1,
'CLOSE': 1,
// In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'.
......@@ -353,7 +353,7 @@ Future<void> runWebServiceWorkerTest({
'flutter.js': 1,
'flutter_service_worker.js': 2,
'main.dart.js': 1,
'assets/AssetManifest.json': 1,
'assets/AssetManifest.bin.json': 1,
'assets/FontManifest.json': 1,
'CLOSE': 1,
if (!headless)
......@@ -383,7 +383,7 @@ Future<void> runWebServiceWorkerTest({
'main.dart.js': 1,
'assets/FontManifest.json': 1,
'flutter_service_worker.js': 1,
'assets/AssetManifest.json': 1,
'assets/AssetManifest.bin.json': 1,
'assets/fonts/MaterialIcons-Regular.otf': 1,
'CLOSE': 1,
// In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'.
......@@ -436,7 +436,7 @@ Future<void> runWebServiceWorkerTest({
'flutter.js': 1,
'flutter_service_worker.js': 2,
'main.dart.js': 1,
'assets/AssetManifest.json': 1,
'assets/AssetManifest.bin.json': 1,
'assets/FontManifest.json': 1,
'CLOSE': 1,
if (!headless)
......@@ -541,7 +541,7 @@ Future<void> runWebServiceWorkerTestWithCachingResources({
'main.dart.js': 1,
'flutter_service_worker.js': 1,
'assets/FontManifest.json': 1,
'assets/AssetManifest.json': 1,
'assets/AssetManifest.bin.json': 1,
'assets/fonts/MaterialIcons-Regular.otf': 1,
// In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'.
if (!headless)
......@@ -600,7 +600,7 @@ Future<void> runWebServiceWorkerTestWithCachingResources({
'main.dart.js': 1,
'flutter_service_worker.js': 2,
'assets/FontManifest.json': 1,
'assets/AssetManifest.json': 1,
'assets/AssetManifest.bin.json': 1,
'assets/fonts/MaterialIcons-Regular.otf': 1,
// In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'.
if (!headless)
......@@ -777,7 +777,7 @@ Future<void> runWebServiceWorkerTestWithCustomServiceWorkerVersion({
'CLOSE': 1,
'flutter_service_worker.js': 1,
'assets/FontManifest.json': 1,
'assets/AssetManifest.json': 1,
'assets/AssetManifest.bin.json': 1,
'assets/fonts/MaterialIcons-Regular.otf': 1,
// In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'.
if (!headless)
......
......@@ -604,8 +604,8 @@ class WebServiceWorker extends Target {
<String>[
'main.dart.js',
'index.html',
if (urlToHash.containsKey('assets/AssetManifest.json'))
'assets/AssetManifest.json',
if (urlToHash.containsKey('assets/AssetManifest.bin.json'))
'assets/AssetManifest.bin.json',
if (urlToHash.containsKey('assets/FontManifest.json'))
'assets/FontManifest.json',
],
......
......@@ -191,7 +191,7 @@ void main() {
expect(environment.outputDir.childFile('main.dart.js')
.existsSync(), true);
expect(environment.outputDir.childDirectory('assets')
.childFile('AssetManifest.json').existsSync(), true);
.childFile('AssetManifest.bin.json').existsSync(), true);
// Update to arbitrary resource file triggers rebuild.
webResources.childFile('foo.txt').writeAsStringSync('B');
......
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