Skip to content

Commit

Permalink
fix #633 Fixing failing tests on Safari/Mac
Browse files Browse the repository at this point in the history
This commit fixes 2 failing tests on Safari/Mac after PR #589
  • Loading branch information
fab-b authored and divdavem committed Jul 19, 2013
1 parent 2869937 commit 7759c47
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
13 changes: 11 additions & 2 deletions test/aria/dom/basic/DomTestCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,19 @@ Aria.classDefinition({
// getGeometry returns the visible part of s1, which is limited by its parent element
this.assertTrue(geo.x < 30, "s1: Expected x < 30, got " + geo.x);
this.assertTrue(geo.y >= 100, "s1: Expected y >= 100, got " + geo.y);
this.assertTrue(geo.width == (100 - scrollbarsWidth), "s1: Expected width == 100 - scollbarsWidth, got "

// On mac, webkit scrollbars are not visualized without scrolling
if (aria.core.Browser.isMac && aria.core.Browser.isWebkit) {
this.assertTrue(geo.width == 100, "s1: Expected width == 100, got "
+ geo.width);
this.assertTrue(geo.height == 100, "s1: Expected height == 100, got "
+ geo.height);
} else {
this.assertTrue(geo.width == (100 - scrollbarsWidth), "s1: Expected width == 100 - scollbarsWidth, got "
+ geo.width);
this.assertTrue(geo.height == (100 - scrollbarsWidth), "s1: Expected height == 100 - scollbarsWidth, got "
this.assertTrue(geo.height == (100 - scrollbarsWidth), "s1: Expected height == 100 - scollbarsWidth, got "
+ geo.height);
}

// End of test
this.notifyTemplateTestEnd();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ Aria.classDefinition({

// set the processing indicator on the child div
myScrolledDiv.setProcessingIndicator(true);
this._checkOverlay(realScrolledDiv, 190 - scrollBarWidth, 90 - scrollBarWidth);
// On mac, webkit scrollbars are not visualized without scrolling
if (aria.core.Browser.isMac && aria.core.Browser.isWebkit) {
this._checkOverlay(realScrolledDiv, 190, 90);
} else {
this._checkOverlay(realScrolledDiv, 190 - scrollBarWidth, 90 - scrollBarWidth);
}
myScrolledDiv.setProcessingIndicator(false);

myParentDiv.setScroll({
Expand All @@ -71,7 +76,11 @@ Aria.classDefinition({
});

myScrolledDiv.setProcessingIndicator(true);
this._checkOverlay(realScrolledDiv, 188 - scrollBarWidth, 38 - scrollBarWidth);
if (aria.core.Browser.isMac && aria.core.Browser.isWebkit) {
this._checkOverlay(realScrolledDiv, 188, 38);
} else {
this._checkOverlay(realScrolledDiv, 188 - scrollBarWidth, 38 - scrollBarWidth);
}
myScrolledDiv.setProcessingIndicator(false);

myParentDiv.setScroll({
Expand All @@ -85,7 +94,11 @@ Aria.classDefinition({
});

myScrolledDiv.setProcessingIndicator(true);
this._checkOverlay(realScrolledDiv, 104 - scrollBarWidth, 112);
if (aria.core.Browser.isMac && aria.core.Browser.isWebkit) {
this._checkOverlay(realScrolledDiv, 104, 112);
} else {
this._checkOverlay(realScrolledDiv, 104 - scrollBarWidth, 112);
}
myScrolledDiv.setProcessingIndicator(false);

myParentDiv.$dispose();
Expand Down

0 comments on commit 7759c47

Please sign in to comment.