4e0481fd8d
Full screen button in the viewer's bottom bar opens a root full-screen route with the same bar and top bar; exit by the bar, Close, Escape or back. It renders the already fetched bytes, never the system browser. The external Open action is now labelled Open in browser. Native web views claim their gestures (vertical drags inline, every pointer in full screen) so the page swipe no longer starves them. On the web, full screen adds zoom buttons that scale the live sandboxed frame. Links: in-page anchors scroll, http(s)/mailto open outside, everything else is inert. Capture kit: --touch, swipe=, pinch=, tabs=; html=1 fixture artifact.
43 lines
1.3 KiB
Dart
43 lines
1.3 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/features/artifacts/domain/artifact_html_links.dart';
|
|
|
|
void main() {
|
|
const inDocument = ArtifactHtmlLinkAction.inDocument;
|
|
const external = ArtifactHtmlLinkAction.external;
|
|
const blocked = ArtifactHtmlLinkAction.blocked;
|
|
|
|
final cases = <String, ArtifactHtmlLinkAction>{
|
|
'#section-2': inDocument,
|
|
' #top ': inDocument,
|
|
'about:blank': inDocument,
|
|
'about:blank#section-2': inDocument,
|
|
'about:srcdoc#top': inDocument,
|
|
'https://example.com/report': external,
|
|
'HTTP://Example.com': external,
|
|
'http://127.0.0.1:8080/x': external,
|
|
'mailto:ops@example.com': external,
|
|
'javascript:alert(1)': blocked,
|
|
' JavaScript:alert(1)': blocked,
|
|
'file:///etc/passwd': blocked,
|
|
'data:text/html,<b>x</b>': blocked,
|
|
'about:config': blocked,
|
|
'intent://scan#Intent;end': blocked,
|
|
'tel:+15551234': blocked,
|
|
'report.html': blocked,
|
|
'../7/2/other.html': blocked,
|
|
'/api/runs': blocked,
|
|
'//example.com/x': blocked,
|
|
'http:no-host': blocked,
|
|
'': blocked,
|
|
};
|
|
|
|
for (final entry in cases.entries) {
|
|
test(
|
|
'${entry.key.isEmpty ? '(empty)' : entry.key} -> ${entry.value.name}',
|
|
() {
|
|
expect(artifactHtmlLinkAction(entry.key), entry.value);
|
|
},
|
|
);
|
|
}
|
|
}
|