Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: davglass/yui3
...
head fork: davglass/yui3
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 34 additions and 21 deletions.
  1. +34 −21 src/dd/tests/unit/assets/dd-tests.js
View
55 src/dd/tests/unit/assets/dd-tests.js
@@ -553,29 +553,42 @@ YUI.add('dd-tests', function(Y) {
Y.Assert.isInstanceOf(Y.Plugin.DDWinScroll, dd.winscroll, 'WinScroll: WinScroll Instance');
- Y.one(window).set('scrollTop', 0);
- Y.one(window).set('scrollLeft', 0);
+ window.scrollTo(0, 0);
_fakeStart(dd);
var self = this,
- winHeight = Y.one(window).get('winHeight'),
- i = (winHeight - dd.get('node').get('offsetHeight') - 100),
- wait = function() {
- if (i < (Y.one(window).get('winHeight') - 30)) {
- _moveNode(dd, i, true);
- i++;
- self.wait.call(self, wait, 0);
- } else {
- self.wait.call(self, function() {
- _fakeEnd(dd);
- Y.Assert.isTrue((Y.one(window).get('scrollTop') > 0), 'window.scrollTop is not greater than 0');
- dd.destroy();
- Y.one('#drag').setStyles({ top: '', left: '' });
- Y.one(window).set('scrollTop', 0);
- Y.one(window).set('scrollLeft', 0);
- Y.one('body').setStyle('height', '');
- }, 1500);
- }
- };
+ win = Y.one(window),
+ winHeight = win.get('winHeight'),
+ i = (winHeight - dd.get('node').get('offsetHeight') - 30),
+ hasScrolled = false,
+ wait = function() {
+ if (win.get('scrollTop')) {
+ hasScrolled = true;
+ }
+ if (i < (Y.one(window).get('winHeight') - 30)) {
+ _moveNode(dd, i, true);
+ i++;
+ self.wait.call(self, wait, 0);
+ } else {
+ if (win.get('scrollTop')) {
+ hasScrolled = true;
+ }
+ self.wait.call(self, function() {
+ _fakeEnd(dd);
+ if (win.get('scrollTop')) {
+ hasScrolled = true;
+ }
+ Y.Assert.isTrue(hasScrolled, 'window.scrollTop was never greater than 0');
+ dd.destroy();
+ Y.one('#drag').setStyles({ top: '', left: '' });
+ window.scrollTo(0, 0);
+ Y.one('body').setStyle('height', '');
+ }, 1500);
+ }
+ };
+
+ win.on('scroll', function() {
+ hasScrolled = true;
+ });
this.wait(wait, 0);
},
test_delegate: function() {

No commit comments for this range

Something went wrong with that request. Please try again.