-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[webview_flutter] fix: unreliable encoding for web #5737
Changes from 4 commits
f8e51ad
e9dfa1f
e0b13de
0b61f9c
99b5c76
5781562
397f609
42bf109
db3c42a
5d9e7c1
15deea5
b760936
d2704ed
7df9cfa
95fd76b
d62c793
c1c4884
61c0028
902e8f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'dart:convert'; | ||
| import 'dart:html'; | ||
| import 'dart:typed_data'; | ||
|
|
||
|
|
@@ -64,7 +65,11 @@ void main() { | |
| // Run | ||
| controller.loadHtmlString('test html'); | ||
| // Verify | ||
| verify(mockElement.src = 'data:text/html,${Uri.encodeFull('test html')}'); | ||
| verify(mockElement.src = Uri.dataFromString( | ||
| 'test html', | ||
|
||
| mimeType: 'text/html', | ||
| encoding: Encoding.getByName('utf-8'), | ||
| ).toString()); | ||
| }); | ||
|
|
||
| group('loadRequest', () { | ||
FlafyDev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
@@ -122,8 +127,11 @@ void main() { | |
| requestHeaders: <String, String>{'Foo': 'Bar'}, | ||
| sendData: Uint8List.fromList('test body'.codeUnits), | ||
| )); | ||
| verify( | ||
| mockElement.src = 'data:text/plain,${Uri.encodeFull('test data')}'); | ||
| verify(mockElement.src = Uri.dataFromString( | ||
| 'test data', | ||
| mimeType: 'text/plain', | ||
| encoding: Encoding.getByName('utf-8'), | ||
| ).toString()); | ||
| }); | ||
| }); | ||
| }); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.