Unverified Commit 80ea4542 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] change service worker load to NOTICES (#58890)

update flutter_service_worker.js to NOTICES
parent 0620cfa7
......@@ -378,7 +378,7 @@ class WebServiceWorker extends Target {
'/',
'main.dart.js',
'index.html',
'assets/LICENSE',
'assets/NOTICES',
if (urlToHash.containsKey('assets/AssetManifest.json'))
'assets/AssetManifest.json',
if (urlToHash.containsKey('assets/FontManifest.json'))
......@@ -543,10 +543,10 @@ async function downloadOffline() {
}
for (var resourceKey in Object.keys(RESOURCES)) {
if (!currentContent[resourceKey]) {
resources.add(resourceKey);
resources.push(resourceKey);
}
}
return Cache.addAll(resources);
return contentCache.addAll(resources);
}
''';
}
......@@ -488,7 +488,11 @@ void main() {
contains('"a/a.txt": "7fc56270e7a70fa81a5935b72eacbe29"'));
expect(environment.buildDir.childFile('service_worker.d'), exists);
// Depends on resource file.
expect(environment.buildDir.childFile('service_worker.d').readAsStringSync(), contains('a/a.txt'));
expect(environment.buildDir.childFile('service_worker.d').readAsStringSync(),
contains('a/a.txt'));
// Contains NOTICES
expect(environment.outputDir.childFile('flutter_service_worker.js').readAsStringSync(),
contains('NOTICES'));
}));
test('WebServiceWorker contains baseUrl cache', () => testbed.run(() async {
......
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