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({ ...@@ -311,7 +311,7 @@ Future<void> runWebServiceWorkerTest({
'main.dart.js': 1, 'main.dart.js': 1,
'flutter_service_worker.js': 1, 'flutter_service_worker.js': 1,
'assets/FontManifest.json': 1, 'assets/FontManifest.json': 1,
'assets/AssetManifest.json': 1, 'assets/AssetManifest.bin.json': 1,
'assets/fonts/MaterialIcons-Regular.otf': 1, 'assets/fonts/MaterialIcons-Regular.otf': 1,
'CLOSE': 1, 'CLOSE': 1,
// In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'. // In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'.
...@@ -353,7 +353,7 @@ Future<void> runWebServiceWorkerTest({ ...@@ -353,7 +353,7 @@ Future<void> runWebServiceWorkerTest({
'flutter.js': 1, 'flutter.js': 1,
'flutter_service_worker.js': 2, 'flutter_service_worker.js': 2,
'main.dart.js': 1, 'main.dart.js': 1,
'assets/AssetManifest.json': 1, 'assets/AssetManifest.bin.json': 1,
'assets/FontManifest.json': 1, 'assets/FontManifest.json': 1,
'CLOSE': 1, 'CLOSE': 1,
if (!headless) if (!headless)
...@@ -383,7 +383,7 @@ Future<void> runWebServiceWorkerTest({ ...@@ -383,7 +383,7 @@ Future<void> runWebServiceWorkerTest({
'main.dart.js': 1, 'main.dart.js': 1,
'assets/FontManifest.json': 1, 'assets/FontManifest.json': 1,
'flutter_service_worker.js': 1, 'flutter_service_worker.js': 1,
'assets/AssetManifest.json': 1, 'assets/AssetManifest.bin.json': 1,
'assets/fonts/MaterialIcons-Regular.otf': 1, 'assets/fonts/MaterialIcons-Regular.otf': 1,
'CLOSE': 1, 'CLOSE': 1,
// In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'. // In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'.
...@@ -436,7 +436,7 @@ Future<void> runWebServiceWorkerTest({ ...@@ -436,7 +436,7 @@ Future<void> runWebServiceWorkerTest({
'flutter.js': 1, 'flutter.js': 1,
'flutter_service_worker.js': 2, 'flutter_service_worker.js': 2,
'main.dart.js': 1, 'main.dart.js': 1,
'assets/AssetManifest.json': 1, 'assets/AssetManifest.bin.json': 1,
'assets/FontManifest.json': 1, 'assets/FontManifest.json': 1,
'CLOSE': 1, 'CLOSE': 1,
if (!headless) if (!headless)
...@@ -541,7 +541,7 @@ Future<void> runWebServiceWorkerTestWithCachingResources({ ...@@ -541,7 +541,7 @@ Future<void> runWebServiceWorkerTestWithCachingResources({
'main.dart.js': 1, 'main.dart.js': 1,
'flutter_service_worker.js': 1, 'flutter_service_worker.js': 1,
'assets/FontManifest.json': 1, 'assets/FontManifest.json': 1,
'assets/AssetManifest.json': 1, 'assets/AssetManifest.bin.json': 1,
'assets/fonts/MaterialIcons-Regular.otf': 1, 'assets/fonts/MaterialIcons-Regular.otf': 1,
// In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'. // In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'.
if (!headless) if (!headless)
...@@ -600,7 +600,7 @@ Future<void> runWebServiceWorkerTestWithCachingResources({ ...@@ -600,7 +600,7 @@ Future<void> runWebServiceWorkerTestWithCachingResources({
'main.dart.js': 1, 'main.dart.js': 1,
'flutter_service_worker.js': 2, 'flutter_service_worker.js': 2,
'assets/FontManifest.json': 1, 'assets/FontManifest.json': 1,
'assets/AssetManifest.json': 1, 'assets/AssetManifest.bin.json': 1,
'assets/fonts/MaterialIcons-Regular.otf': 1, 'assets/fonts/MaterialIcons-Regular.otf': 1,
// In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'. // In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'.
if (!headless) if (!headless)
...@@ -777,7 +777,7 @@ Future<void> runWebServiceWorkerTestWithCustomServiceWorkerVersion({ ...@@ -777,7 +777,7 @@ Future<void> runWebServiceWorkerTestWithCustomServiceWorkerVersion({
'CLOSE': 1, 'CLOSE': 1,
'flutter_service_worker.js': 1, 'flutter_service_worker.js': 1,
'assets/FontManifest.json': 1, 'assets/FontManifest.json': 1,
'assets/AssetManifest.json': 1, 'assets/AssetManifest.bin.json': 1,
'assets/fonts/MaterialIcons-Regular.otf': 1, 'assets/fonts/MaterialIcons-Regular.otf': 1,
// In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'. // In headless mode Chrome does not load 'manifest.json' and 'favicon.ico'.
if (!headless) if (!headless)
......
...@@ -604,8 +604,8 @@ class WebServiceWorker extends Target { ...@@ -604,8 +604,8 @@ class WebServiceWorker extends Target {
<String>[ <String>[
'main.dart.js', 'main.dart.js',
'index.html', 'index.html',
if (urlToHash.containsKey('assets/AssetManifest.json')) if (urlToHash.containsKey('assets/AssetManifest.bin.json'))
'assets/AssetManifest.json', 'assets/AssetManifest.bin.json',
if (urlToHash.containsKey('assets/FontManifest.json')) if (urlToHash.containsKey('assets/FontManifest.json'))
'assets/FontManifest.json', 'assets/FontManifest.json',
], ],
......
...@@ -191,7 +191,7 @@ void main() { ...@@ -191,7 +191,7 @@ void main() {
expect(environment.outputDir.childFile('main.dart.js') expect(environment.outputDir.childFile('main.dart.js')
.existsSync(), true); .existsSync(), true);
expect(environment.outputDir.childDirectory('assets') expect(environment.outputDir.childDirectory('assets')
.childFile('AssetManifest.json').existsSync(), true); .childFile('AssetManifest.bin.json').existsSync(), true);
// Update to arbitrary resource file triggers rebuild. // Update to arbitrary resource file triggers rebuild.
webResources.childFile('foo.txt').writeAsStringSync('B'); 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