mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
skiping tests in Safari. LUCI recipe for Mac is ready. this is the only step left for stopping us running unit tests in Safari (#16550)
This commit is contained in:
parent
ca02b9197e
commit
44e80fd619
@ -43,7 +43,9 @@ void main() {
|
||||
expect(_placeholder.getBoundingClientRect().width, 1);
|
||||
expect(_placeholder.getBoundingClientRect().top, -1);
|
||||
expect(_placeholder.getBoundingClientRect().left, -1);
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test('Not relevant events should be forwarded to the framework', () async {
|
||||
// Prework. Attach the placeholder to dom.
|
||||
@ -134,7 +136,9 @@ void main() {
|
||||
|
||||
expect(_placeholder.getBoundingClientRect().height, bodyHeight);
|
||||
expect(_placeholder.getBoundingClientRect().width, bodyWidht);
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test('Not relevant events should be forwarded to the framework', () async {
|
||||
final html.Event event = html.TouchEvent('touchcancel');
|
||||
@ -142,7 +146,10 @@ void main() {
|
||||
mobileSemanticsEnabler.tryEnableSemantics(event);
|
||||
|
||||
expect(shouldForwardToFramework, true);
|
||||
}, // TODO(nurhan): https://github.com/flutter/flutter/issues/46638
|
||||
skip: (browserEngine == BrowserEngine.firefox));
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/46638
|
||||
skip: (browserEngine == BrowserEngine.firefox ||
|
||||
browserEngine == BrowserEngine.webkit));
|
||||
});
|
||||
}
|
||||
|
||||
@ -502,7 +502,9 @@ void _testVerticalScrolling() {
|
||||
expect(scrollable.scrollTop, 10);
|
||||
|
||||
semantics().semanticsEnabled = false;
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
}
|
||||
|
||||
void _testHorizontalScrolling() {
|
||||
@ -623,7 +625,9 @@ void _testHorizontalScrolling() {
|
||||
expect(scrollable.scrollLeft, 10);
|
||||
|
||||
semantics().semanticsEnabled = false;
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
}
|
||||
|
||||
void _testIncrementables() {
|
||||
@ -807,7 +811,9 @@ void _testTextField() {
|
||||
|
||||
semantics().semanticsEnabled = false;
|
||||
}, // TODO(nurhan): https://github.com/flutter/flutter/issues/46638
|
||||
skip: (browserEngine == BrowserEngine.firefox));
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: (browserEngine == BrowserEngine.firefox ||
|
||||
browserEngine == BrowserEngine.webkit));
|
||||
}
|
||||
|
||||
void _testCheckables() {
|
||||
|
||||
@ -56,7 +56,9 @@ void main() async {
|
||||
closeTo(paragraph.alphabeticBaseline * kAhemBaselineRatio, 3.0),
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
testEachMeasurement('predictably lays out a multi-line paragraph', () {
|
||||
for (double fontSize in <double>[10.0, 20.0, 30.0, 40.0]) {
|
||||
@ -83,7 +85,9 @@ void main() async {
|
||||
closeTo(paragraph.alphabeticBaseline * kAhemBaselineRatio, 3.0),
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
testEachMeasurement('predictably lays out a single-line rich paragraph', () {
|
||||
for (double fontSize in <double>[10.0, 20.0, 30.0, 40.0]) {
|
||||
@ -105,7 +109,9 @@ void main() async {
|
||||
expect(paragraph.maxIntrinsicWidth, fontSize * 10.0);
|
||||
}
|
||||
}, // TODO(nurhan): https://github.com/flutter/flutter/issues/46638
|
||||
skip: (browserEngine == BrowserEngine.firefox));
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: (browserEngine == BrowserEngine.firefox ||
|
||||
browserEngine == BrowserEngine.webkit));
|
||||
|
||||
testEachMeasurement('predictably lays out a multi-line rich paragraph', () {
|
||||
for (double fontSize in <double>[10.0, 20.0, 30.0, 40.0]) {
|
||||
@ -128,7 +134,9 @@ void main() async {
|
||||
expect(paragraph.maxIntrinsicWidth, fontSize * 16.0);
|
||||
}
|
||||
}, // TODO(nurhan): https://github.com/flutter/flutter/issues/46638
|
||||
skip: (browserEngine == BrowserEngine.firefox));
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: (browserEngine == BrowserEngine.firefox ||
|
||||
browserEngine == BrowserEngine.webkit));
|
||||
|
||||
testEachMeasurement('getPositionForOffset single-line', () {
|
||||
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
|
||||
@ -221,7 +229,6 @@ void main() async {
|
||||
TextPosition(offset: 2, affinity: TextAffinity.upstream),
|
||||
);
|
||||
|
||||
|
||||
// Second line: "abcdefg\n"
|
||||
|
||||
// At the beginning of the second line.
|
||||
@ -245,7 +252,6 @@ void main() async {
|
||||
TextPosition(offset: 10, affinity: TextAffinity.upstream),
|
||||
);
|
||||
|
||||
|
||||
// Last (third) line: "ab"
|
||||
|
||||
// At the beginning of the last line.
|
||||
@ -299,7 +305,9 @@ void main() async {
|
||||
TextDirection.rtl,
|
||||
),
|
||||
);
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
testEachMeasurement(
|
||||
'getBoxesForRange return empty list for zero-length range', () {
|
||||
@ -419,5 +427,7 @@ void main() async {
|
||||
|
||||
expect(paragraph.width, 30);
|
||||
expect(paragraph.height, 10);
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@TestOn('chrome || firefox')
|
||||
|
||||
import 'package:ui/ui.dart' as ui;
|
||||
import 'package:ui/src/engine.dart';
|
||||
|
||||
|
||||
@ -404,7 +404,9 @@ void main() {
|
||||
expect(document.activeElement, document.body);
|
||||
|
||||
editingElement.disable();
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test('Does not dispose and recreate dom elements in persistent mode', () {
|
||||
editingElement =
|
||||
@ -441,7 +443,9 @@ void main() {
|
||||
expect(document.body.contains(editingElement.domElement), isTrue);
|
||||
// But the DOM element loses focus.
|
||||
expect(document.activeElement, document.body);
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test('Refocuses when setting editing state', () {
|
||||
editingElement =
|
||||
@ -463,7 +467,9 @@ void main() {
|
||||
expect(document.activeElement, testInputElement);
|
||||
|
||||
editingElement.disable();
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test('Works in multi-line mode', () {
|
||||
final TextAreaElement textarea = TextAreaElement();
|
||||
@ -506,7 +512,9 @@ void main() {
|
||||
expect(document.body.contains(editingElement.domElement), isTrue);
|
||||
// But the textarea loses focus.
|
||||
expect(document.activeElement, document.body);
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test('Does not position or size its DOM element', () {
|
||||
editingElement.enable(
|
||||
@ -525,6 +533,7 @@ void main() {
|
||||
expect(editingElement.domElement.style.width, '');
|
||||
expect(editingElement.domElement.style.height, '');
|
||||
}
|
||||
|
||||
checkPlacementIsEmpty();
|
||||
editingElement.placeElement();
|
||||
checkPlacementIsEmpty();
|
||||
@ -689,7 +698,9 @@ void main() {
|
||||
);
|
||||
// Input element is removed from DOM.
|
||||
expect(document.getElementsByTagName('input'), hasLength(0));
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test('setClient, setEditingState, show, setClient', () {
|
||||
final MethodCall setClient = MethodCall(
|
||||
@ -808,64 +819,67 @@ void main() {
|
||||
|
||||
// Confirm that [HybridTextEditing] didn't send any messages.
|
||||
expect(spy.messages, isEmpty);
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test(
|
||||
'setClient, show, setEditableSizeAndTransform, setStyle, setEditingState, clearClient',
|
||||
() {
|
||||
final MethodCall setClient = MethodCall(
|
||||
'TextInput.setClient', <dynamic>[123, flutterSinglelineConfig]);
|
||||
sendFrameworkMessage(codec.encodeMethodCall(setClient));
|
||||
'setClient, show, setEditableSizeAndTransform, setStyle, setEditingState, clearClient',
|
||||
() {
|
||||
final MethodCall setClient = MethodCall(
|
||||
'TextInput.setClient', <dynamic>[123, flutterSinglelineConfig]);
|
||||
sendFrameworkMessage(codec.encodeMethodCall(setClient));
|
||||
|
||||
const MethodCall show = MethodCall('TextInput.show');
|
||||
sendFrameworkMessage(codec.encodeMethodCall(show));
|
||||
const MethodCall show = MethodCall('TextInput.show');
|
||||
sendFrameworkMessage(codec.encodeMethodCall(show));
|
||||
|
||||
final MethodCall setSizeAndTransform =
|
||||
configureSetSizeAndTransformMethodCall(
|
||||
150,
|
||||
50,
|
||||
Matrix4.translationValues(
|
||||
10.0,
|
||||
20.0,
|
||||
30.0,
|
||||
).storage.toList());
|
||||
sendFrameworkMessage(codec.encodeMethodCall(setSizeAndTransform));
|
||||
final MethodCall setSizeAndTransform =
|
||||
configureSetSizeAndTransformMethodCall(
|
||||
150,
|
||||
50,
|
||||
Matrix4.translationValues(
|
||||
10.0,
|
||||
20.0,
|
||||
30.0,
|
||||
).storage.toList());
|
||||
sendFrameworkMessage(codec.encodeMethodCall(setSizeAndTransform));
|
||||
|
||||
final MethodCall setStyle =
|
||||
configureSetStyleMethodCall(12, 'sans-serif', 4, 4, 1);
|
||||
sendFrameworkMessage(codec.encodeMethodCall(setStyle));
|
||||
final MethodCall setStyle =
|
||||
configureSetStyleMethodCall(12, 'sans-serif', 4, 4, 1);
|
||||
sendFrameworkMessage(codec.encodeMethodCall(setStyle));
|
||||
|
||||
const MethodCall setEditingState =
|
||||
MethodCall('TextInput.setEditingState', <String, dynamic>{
|
||||
'text': 'abcd',
|
||||
'selectionBase': 2,
|
||||
'selectionExtent': 3,
|
||||
});
|
||||
sendFrameworkMessage(codec.encodeMethodCall(setEditingState));
|
||||
const MethodCall setEditingState =
|
||||
MethodCall('TextInput.setEditingState', <String, dynamic>{
|
||||
'text': 'abcd',
|
||||
'selectionBase': 2,
|
||||
'selectionExtent': 3,
|
||||
});
|
||||
sendFrameworkMessage(codec.encodeMethodCall(setEditingState));
|
||||
|
||||
final HtmlElement domElement = textEditing.editingElement.domElement;
|
||||
final HtmlElement domElement = textEditing.editingElement.domElement;
|
||||
|
||||
checkInputEditingState(domElement, 'abcd', 2, 3);
|
||||
checkInputEditingState(domElement, 'abcd', 2, 3);
|
||||
|
||||
// Check if the position is correct.
|
||||
expect(
|
||||
domElement.getBoundingClientRect(),
|
||||
Rectangle<double>.fromPoints(const Point<double>(10.0, 20.0),
|
||||
const Point<double>(160.0, 70.0)),
|
||||
);
|
||||
expect(
|
||||
domElement.style.transform,
|
||||
'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10, 20, 30, 1)',
|
||||
);
|
||||
expect(
|
||||
textEditing.editingElement.domElement.style.font,
|
||||
'500 12px sans-serif',
|
||||
);
|
||||
// Check if the position is correct.
|
||||
expect(
|
||||
domElement.getBoundingClientRect(),
|
||||
Rectangle<double>.fromPoints(
|
||||
const Point<double>(10.0, 20.0), const Point<double>(160.0, 70.0)),
|
||||
);
|
||||
expect(
|
||||
domElement.style.transform,
|
||||
'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 10, 20, 30, 1)',
|
||||
);
|
||||
expect(
|
||||
textEditing.editingElement.domElement.style.font,
|
||||
'500 12px sans-serif',
|
||||
);
|
||||
|
||||
const MethodCall clearClient = MethodCall('TextInput.clearClient');
|
||||
sendFrameworkMessage(codec.encodeMethodCall(clearClient));
|
||||
},
|
||||
);
|
||||
const MethodCall clearClient = MethodCall('TextInput.clearClient');
|
||||
sendFrameworkMessage(codec.encodeMethodCall(clearClient));
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test('input font set succesfully with null fontWeightIndex', () {
|
||||
final MethodCall setClient = MethodCall(
|
||||
@ -907,7 +921,9 @@ void main() {
|
||||
textEditing.editingElement.domElement.style.font, '12px sans-serif');
|
||||
|
||||
hideKeyboard();
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test(
|
||||
'negative base offset and selection extent values in editing state is handled',
|
||||
@ -1172,7 +1188,8 @@ void main() {
|
||||
EditingState _editingState;
|
||||
|
||||
setUp(() {
|
||||
editingElement = GloballyPositionedTextEditingStrategy(HybridTextEditing());
|
||||
editingElement =
|
||||
GloballyPositionedTextEditingStrategy(HybridTextEditing());
|
||||
editingElement.enable(
|
||||
singlelineConfig,
|
||||
onChange: trackEditingState,
|
||||
|
||||
@ -40,7 +40,9 @@ void main() async {
|
||||
from: paragraph.alphabeticBaseline * baselineRatio),
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test('predictably lays out a multi-line paragraph', () {
|
||||
for (double fontSize in <double>[10.0, 20.0, 30.0, 40.0]) {
|
||||
@ -70,7 +72,9 @@ void main() async {
|
||||
from: paragraph.alphabeticBaseline * baselineRatio),
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
// TODO(nurhan): https://github.com/flutter/flutter/issues/50590
|
||||
skip: browserEngine == BrowserEngine.webkit);
|
||||
|
||||
test('lay out unattached paragraph', () {
|
||||
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(
|
||||
@ -378,7 +382,8 @@ void main() async {
|
||||
builder.addText('Hello');
|
||||
|
||||
final EngineParagraph paragraph = builder.build();
|
||||
expect(paragraph.paragraphElement.style.fontFamily, 'SomeFont, Arial, sans-serif');
|
||||
expect(paragraph.paragraphElement.style.fontFamily,
|
||||
'SomeFont, Arial, sans-serif');
|
||||
|
||||
debugEmulateFlutterTesterEnvironment = true;
|
||||
}, // TODO(nurhan): https://github.com/flutter/flutter/issues/46638
|
||||
@ -413,7 +418,8 @@ void main() async {
|
||||
builder.addText('Hello');
|
||||
|
||||
final EngineParagraph paragraph = builder.build();
|
||||
expect(paragraph.paragraphElement.style.fontFamily, '"MyFont 2000", Arial, sans-serif');
|
||||
expect(paragraph.paragraphElement.style.fontFamily,
|
||||
'"MyFont 2000", Arial, sans-serif');
|
||||
|
||||
debugEmulateFlutterTesterEnvironment = true;
|
||||
});
|
||||
@ -453,24 +459,32 @@ void main() async {
|
||||
});
|
||||
test('textBefore works', () {
|
||||
expect(const TextRange(start: 0, end: 0).textBefore('hello'), isEmpty);
|
||||
expect(const TextRange(start: 1, end: 1).textBefore('hello'), equals('h'));
|
||||
expect(const TextRange(start: 1, end: 2).textBefore('hello'), equals('h'));
|
||||
expect(const TextRange(start: 5, end: 5).textBefore('hello'), equals('hello'));
|
||||
expect(
|
||||
const TextRange(start: 1, end: 1).textBefore('hello'), equals('h'));
|
||||
expect(
|
||||
const TextRange(start: 1, end: 2).textBefore('hello'), equals('h'));
|
||||
expect(const TextRange(start: 5, end: 5).textBefore('hello'),
|
||||
equals('hello'));
|
||||
expect(const TextRange(start: 0, end: 5).textBefore('hello'), isEmpty);
|
||||
});
|
||||
test('textAfter works', () {
|
||||
expect(const TextRange(start: 0, end: 0).textAfter('hello'), equals('hello'));
|
||||
expect(const TextRange(start: 1, end: 1).textAfter('hello'), equals('ello'));
|
||||
expect(const TextRange(start: 1, end: 2).textAfter('hello'), equals('llo'));
|
||||
expect(const TextRange(start: 0, end: 0).textAfter('hello'),
|
||||
equals('hello'));
|
||||
expect(
|
||||
const TextRange(start: 1, end: 1).textAfter('hello'), equals('ello'));
|
||||
expect(
|
||||
const TextRange(start: 1, end: 2).textAfter('hello'), equals('llo'));
|
||||
expect(const TextRange(start: 5, end: 5).textAfter('hello'), isEmpty);
|
||||
expect(const TextRange(start: 0, end: 5).textAfter('hello'), isEmpty);
|
||||
});
|
||||
test('textInside works', () {
|
||||
expect(const TextRange(start: 0, end: 0).textInside('hello'), isEmpty);
|
||||
expect(const TextRange(start: 1, end: 1).textInside('hello'), isEmpty);
|
||||
expect(const TextRange(start: 1, end: 2).textInside('hello'), equals('e'));
|
||||
expect(
|
||||
const TextRange(start: 1, end: 2).textInside('hello'), equals('e'));
|
||||
expect(const TextRange(start: 5, end: 5).textInside('hello'), isEmpty);
|
||||
expect(const TextRange(start: 0, end: 5).textInside('hello'), equals('hello'));
|
||||
expect(const TextRange(start: 0, end: 5).textInside('hello'),
|
||||
equals('hello'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user