Bug 110708 - Fix the tests based on computedStyleIncludingVisitedInfo for asynchronous update of the visited style
Summary: Fix the tests based on computedStyleIncludingVisitedInfo for asynchronous upd...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-24 00:08 PST by Benjamin Poulain
Modified: 2013-02-27 00:31 PST (History)
1 user (show)

See Also:


Attachments
Patch (15.79 KB, patch)
2013-02-24 00:15 PST, Benjamin Poulain
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2013-02-24 00:08:09 PST
Fix the tests based on computedStyleIncludingVisitedInfo for asynchronous update of the visited style
Comment 1 Benjamin Poulain 2013-02-24 00:15:46 PST
Created attachment 189960 [details]
Patch
Comment 2 Ryosuke Niwa 2013-02-26 21:16:38 PST
Comment on attachment 189960 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=189960&action=review

> LayoutTests/ChangeLog:11
> +        WebKit because the list of visited URLs is maintained outside the Web Process.

Nit: WebProcess.

> LayoutTests/fast/js/resources/js-test-pre.js:347
> +  if (typeof _a != "string" || typeof _b != "string")
> +    debug("WARN: shouldBecomeDifferent() expects string arguments");
> +  if (timeout === undefined)
> +    timeout = 500;
> +
> +  var condition = function() {
> +    var exception;
> +    var _av;
> +    try {
> +      _av = eval(_a);
> +    } catch (e) {
> +      exception = e;
> +    }
> +    var _bv = eval(_b);
> +    if (exception)
> +      testFailed(_a + " should became not equal to " + _bv + ". Threw exception " + exception);
> +    if (!isResultCorrect(_av, _bv)) {
> +      testPassed(_a + " became different from " + _b);
> +      return true;
> +    }
> +    return false;
> +  };

It's unfortunate that we have to duplicate so much code.

> LayoutTests/fast/js/resources/js-test-pre.js:348
> +  var failureTime = Date.now() + timeout;

We should probably call window.performance.now() when available so that we may not get affected by the system clock being adjusted while we're running this test.
But that should probably be done in a separate patch since we also want to fix shouldBecomeEqual.
Comment 3 Benjamin Poulain 2013-02-27 00:31:11 PST
Committed r144152: <http://trac.webkit.org/changeset/144152>