Skip to content

Commit fe995b9

Browse files
committed
Disable some tests on old Opera versions
1 parent 9dd6275 commit fe995b9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function byClassName(elt, cls) {
2525
var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent);
2626
var mac = /Mac/.test(navigator.platform);
2727
var phantom = /PhantomJS/.test(navigator.userAgent);
28+
var opera_lt10 = /Opera\/[1-9]\./.test(navigator.userAgent);
2829

2930
test("core_fromTextArea", function() {
3031
var te = document.getElementById("code");
@@ -674,7 +675,7 @@ testCM("wrappingAndResizing", function(cm) {
674675
cm.setValue(doc);
675676
for (var step = 10, w = cm.charCoords({line: 0, ch: 18}, "div").right;; w += step) {
676677
cm.setSize(w);
677-
if (wrap.offsetHeight <= h0 * 1.5) {
678+
if (wrap.offsetHeight <= h0 * (opera_lt10 ? 1.2 : 1.5)) {
678679
if (step == 10) { w -= 10; step = 1; }
679680
else break;
680681
}
@@ -715,7 +716,7 @@ testCM("measureEndOfLine", function(cm) {
715716
is(endPos.left > w - 20, "not at right");
716717
endPos = cm.charCoords({line: 0, ch: 18});
717718
eqPos(cm.coordsChar({left: endPos.left, top: endPos.top + 5}), {line: 0, ch: 18});
718-
}, {mode: "text/html", value: "<!-- foo barrr -->", lineWrapping: true}, ie_lt8);
719+
}, {mode: "text/html", value: "<!-- foo barrr -->", lineWrapping: true}, ie_lt8 || opera_lt10);
719720

720721
testCM("scrollVerticallyAndHorizontally", function(cm) {
721722
cm.setSize(100, 100);
@@ -740,7 +741,7 @@ testCM("moveVstuck", function(cm) {
740741
cm.setCursor({line: 0, ch: val.length - 1});
741742
cm.moveV(-1, "line");
742743
eqPos(cm.getCursor(), {line: 0, ch: 26});
743-
}, {lineWrapping: true}, ie_lt8);
744+
}, {lineWrapping: true}, ie_lt8 || opera_lt10);
744745

745746
testCM("clickTab", function(cm) {
746747
var p0 = cm.charCoords({line: 0, ch: 0});

0 commit comments

Comments
 (0)