Changeset 177682 in webkit


Ignore:
Timestamp:
Dec 23, 2014 12:26:49 AM (9 years ago)
Author:
g.czajkowski@samsung.com
Message:

shouldBecomeEqual() behaves as shouldBe() if the testing expression returns the expected value
https://bugs.webkit.org/show_bug.cgi?id=133939

Reviewed by Darin Adler.

First call of eval(expression) inside shouldBecomeEqual was always
made synchronously. If the testing expression returns the same value
as expected one then shouldBecomeEqual() will immediately report PASS,
for example,

shouldBecomeEqual(internals.hasSpellingMarker("wellcome"), false);

in consequence, assuming asynchronous path of spellchecking, spelling markers
may appear after a while.

The bug was caused by checking a condition at the beginning of shouldBecomeEqual(),
before calling a timer. As a result, queued asynchronous events doesn't effect
this checking.

This fix reveals new bugs in execDeleteCommand() behaviour, two tests need
to marked as failure now.

  • resources/js-test-pre.js:

(.condition):
(shouldBecomeEqual):
(shouldBecomeDifferent):

  • resources/js-test.js:

(.condition):
(shouldBecomeEqual):
(shouldBecomeDifferent):
Always check a condition on timer.

Location:
trunk/LayoutTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r177679 r177682  
     12014-12-23  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
     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
    1362014-12-22  Alexey Proskuryakov  <ap@apple.com>
    237
  • trunk/LayoutTests/TestExpectations

    r177653 r177682  
    1010
    1111webkit.org/b/116473 editing/selection/user-drag-element-and-user-select-none.html [ Failure ]
     12
     13webkit.org/b/139862 editing/spelling/editing-multiple-words-with-markers.html [ Timeout ]
     14webkit.org/b/139862 editing/spelling/grammar-edit-word.html [ Timeout ]
    1215
    1316# media/W3C/video/networkState/networkState_during_progress.html is flaky
  • trunk/LayoutTests/resources/js-test-pre.js

    r166668 r177682  
    290290    debug("WARN: shouldBecomeEqual() expects string arguments");
    291291
    292   var condition = function() {
     292  function condition() {
    293293    var exception;
    294294    var _av;
     
    306306    }
    307307    return false;
    308   };
    309   _waitForCondition(condition, completionHandler);
     308  }
     309  setTimeout(_waitForCondition, 0, condition, completionHandler);
    310310}
    311311
     
    402402    debug("WARN: shouldBecomeDifferent() expects string arguments");
    403403
    404   var condition = function() {
     404  function condition() {
    405405    var exception;
    406406    var _av;
     
    418418    }
    419419    return false;
    420   };
    421   _waitForCondition(condition, completionHandler);
     420  }
     421  setTimeout(_waitForCondition, 0, condition, completionHandler);
    422422}
    423423
  • trunk/LayoutTests/resources/js-test.js

    r177501 r177682  
    257257    debug("WARN: shouldBecomeEqual() expects string arguments");
    258258
    259   var condition = function() {
     259  function condition() {
    260260    var exception;
    261261    var _av;
     
    273273    }
    274274    return false;
    275   };
    276   _waitForCondition(condition, completionHandler);
     275  }
     276  setTimeout(_waitForCondition, 0, condition, completionHandler);
    277277}
    278278
     
    369369    debug("WARN: shouldBecomeDifferent() expects string arguments");
    370370
    371   var condition = function() {
     371  function condition() {
    372372    var exception;
    373373    var _av;
     
    385385    }
    386386    return false;
    387   };
    388   _waitForCondition(condition, completionHandler);
     387  }
     388  setTimeout(_waitForCondition, 0, condition, completionHandler);
    389389}
    390390
Note: See TracChangeset for help on using the changeset viewer.