| Differences between
and this patch
- a/LayoutTests/ChangeLog +35 lines
Lines 1-5 a/LayoutTests/ChangeLog_sec1
1
2014-12-18  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
1
2014-12-18  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
2
2
3
        shouldBecomeEqual() behaves as shouldBe() if the testing expression returns the expected value
4
        https://bugs.webkit.org/show_bug.cgi?id=133939
5
6
        Reviewed by Darin Adler.
7
8
        First call of eval(expression) inside shouldBecomeEqual was always
9
        made synchronously. If the testing expression returns the same value
10
        as expected one then shouldBecomeEqual() will immediately report PASS,
11
        for example,
12
13
        shouldBecomeEqual(internals.hasSpellingMarker("wellcome"), false);
14
15
        in consequence, assuming asynchronous path of spellchecking, spelling markers
16
        may appear after a while.
17
18
        The bug was caused by checking a condition at the beginning of shouldBecomeEqual(),
19
        before calling a timer. As a result, queued asynchronous events doesn't effect
20
        this checking.
21
22
        * TestExpectations:
23
        This fix reveals new bugs in execDeleteCommand() behaviour, two tests need
24
        to marked as failure now.
25
26
        * resources/js-test-pre.js:
27
        (.condition):
28
        (shouldBecomeEqual):
29
        (shouldBecomeDifferent):
30
        * resources/js-test.js:
31
        (.condition):
32
        (shouldBecomeEqual):
33
        (shouldBecomeDifferent):
34
        Always check a condition on timer.
35
36
2014-12-18  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
37
3
        Remove timeout from shouldBecome* functions in js-test.js
38
        Remove timeout from shouldBecome* functions in js-test.js
4
        https://bugs.webkit.org/show_bug.cgi?id=139767
39
        https://bugs.webkit.org/show_bug.cgi?id=139767
5
40
- a/LayoutTests/TestExpectations +3 lines
Lines 10-15 webkit.org/b/116293 media/video-seek-after-end.html [ Pass Failure ] a/LayoutTests/TestExpectations_sec1
10
10
11
webkit.org/b/116473 editing/selection/user-drag-element-and-user-select-none.html [ Failure ]
11
webkit.org/b/116473 editing/selection/user-drag-element-and-user-select-none.html [ Failure ]
12
12
13
webkit.org/b/139862 editing/spelling/editing-multiple-words-with-markers.html [ Timeout ]
14
webkit.org/b/139862 editing/spelling/grammar-edit-word.html [ Timeout ]
15
13
# media/W3C/video/networkState/networkState_during_progress.html is flaky
16
# media/W3C/video/networkState/networkState_during_progress.html is flaky
14
webkit.org/b/76280 media/W3C/video/networkState/networkState_during_progress.html [ Pass Failure ]
17
webkit.org/b/76280 media/W3C/video/networkState/networkState_during_progress.html [ Pass Failure ]
15
18
- a/LayoutTests/resources/js-test-pre.js -6 / +6 lines
Lines 289-295 function shouldBecomeEqual(_a, _b, completionHandler) a/LayoutTests/resources/js-test-pre.js_sec1
289
  if (typeof _a != "string" || typeof _b != "string")
289
  if (typeof _a != "string" || typeof _b != "string")
290
    debug("WARN: shouldBecomeEqual() expects string arguments");
290
    debug("WARN: shouldBecomeEqual() expects string arguments");
291
291
292
  var condition = function() {
292
  function condition() {
293
    var exception;
293
    var exception;
294
    var _av;
294
    var _av;
295
    try {
295
    try {
Lines 305-312 function shouldBecomeEqual(_a, _b, completionHandler) a/LayoutTests/resources/js-test-pre.js_sec2
305
      return true;
305
      return true;
306
    }
306
    }
307
    return false;
307
    return false;
308
  };
308
  }
309
  _waitForCondition(condition, completionHandler);
309
  setTimeout(_waitForCondition, 0, condition, completionHandler);
310
}
310
}
311
311
312
function shouldBecomeEqualToString(value, reference, completionHandler)
312
function shouldBecomeEqualToString(value, reference, completionHandler)
Lines 401-407 function shouldBecomeDifferent(_a, _b, completionHandler) a/LayoutTests/resources/js-test-pre.js_sec3
401
  if (typeof _a != "string" || typeof _b != "string")
401
  if (typeof _a != "string" || typeof _b != "string")
402
    debug("WARN: shouldBecomeDifferent() expects string arguments");
402
    debug("WARN: shouldBecomeDifferent() expects string arguments");
403
403
404
  var condition = function() {
404
  function condition() {
405
    var exception;
405
    var exception;
406
    var _av;
406
    var _av;
407
    try {
407
    try {
Lines 417-424 function shouldBecomeDifferent(_a, _b, completionHandler) a/LayoutTests/resources/js-test-pre.js_sec4
417
      return true;
417
      return true;
418
    }
418
    }
419
    return false;
419
    return false;
420
  };
420
  }
421
  _waitForCondition(condition, completionHandler);
421
  setTimeout(_waitForCondition, 0, condition, completionHandler);
422
}
422
}
423
423
424
function shouldBeTrue(_a) { shouldBe(_a, "true"); }
424
function shouldBeTrue(_a) { shouldBe(_a, "true"); }
- a/LayoutTests/resources/js-test.js -6 / +6 lines
Lines 256-262 function shouldBecomeEqual(_a, _b, completionHandler) a/LayoutTests/resources/js-test.js_sec1
256
  if (typeof _a != "string" || typeof _b != "string")
256
  if (typeof _a != "string" || typeof _b != "string")
257
    debug("WARN: shouldBecomeEqual() expects string arguments");
257
    debug("WARN: shouldBecomeEqual() expects string arguments");
258
258
259
  var condition = function() {
259
  function condition() {
260
    var exception;
260
    var exception;
261
    var _av;
261
    var _av;
262
    try {
262
    try {
Lines 272-279 function shouldBecomeEqual(_a, _b, completionHandler) a/LayoutTests/resources/js-test.js_sec2
272
      return true;
272
      return true;
273
    }
273
    }
274
    return false;
274
    return false;
275
  };
275
  }
276
  _waitForCondition(condition, completionHandler);
276
  setTimeout(_waitForCondition, 0, condition, completionHandler);
277
}
277
}
278
278
279
function shouldBecomeEqualToString(value, reference, completionHandler)
279
function shouldBecomeEqualToString(value, reference, completionHandler)
Lines 368-374 function shouldBecomeDifferent(_a, _b, completionHandler) a/LayoutTests/resources/js-test.js_sec3
368
  if (typeof _a != "string" || typeof _b != "string")
368
  if (typeof _a != "string" || typeof _b != "string")
369
    debug("WARN: shouldBecomeDifferent() expects string arguments");
369
    debug("WARN: shouldBecomeDifferent() expects string arguments");
370
370
371
  var condition = function() {
371
  function condition() {
372
    var exception;
372
    var exception;
373
    var _av;
373
    var _av;
374
    try {
374
    try {
Lines 384-391 function shouldBecomeDifferent(_a, _b, completionHandler) a/LayoutTests/resources/js-test.js_sec4
384
      return true;
384
      return true;
385
    }
385
    }
386
    return false;
386
    return false;
387
  };
387
  }
388
  _waitForCondition(condition, completionHandler);
388
  setTimeout(_waitForCondition, 0, condition, completionHandler);
389
}
389
}
390
390
391
function shouldBeTrue(a, quiet) { shouldBe(a, "true", quiet); }
391
function shouldBeTrue(a, quiet) { shouldBe(a, "true", quiet); }

Return to Bug 133939