Changeset 106801 in webkit


Ignore:
Timestamp:
Feb 6, 2012 5:24:20 AM (12 years ago)
Author:
hans@chromium.org
Message:

Speech input: fix fast/speech/bubble-position.html
https://bugs.webkit.org/show_bug.cgi?id=77732

Reviewed by Tony Gentilcore.

There is no need for the test to check the pixel-exact position of the
rect, since that seems to vary a little between platforms.
The point of the test is to check that the rect is within the iframe,
so let's do that.

  • fast/speech/bubble-position-expected.txt:
  • fast/speech/bubble-position.html:
Location:
trunk/LayoutTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106797 r106801  
     12012-02-03  Hans Wennborg  <hans@chromium.org>
     2
     3        Speech input: fix fast/speech/bubble-position.html
     4        https://bugs.webkit.org/show_bug.cgi?id=77732
     5
     6        Reviewed by Tony Gentilcore.
     7
     8        There is no need for the test to check the pixel-exact position of the
     9        rect, since that seems to vary a little between platforms.
     10        The point of the test is to check that the rect is within the iframe,
     11        so let's do that.
     12
     13        * fast/speech/bubble-position-expected.txt:
     14        * fast/speech/bubble-position.html:
     15
    1162012-02-06  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
    217
  • trunk/LayoutTests/fast/speech/bubble-position-expected.txt

    r106438 r106801  
    55
    66Clicking the speech button.
    7 onSpeechChange()
    8 PASS input.value === expectedString is true
     7PASS rect is inside the iframe
    98PASS successfullyParsed is true
    109
  • trunk/LayoutTests/fast/speech/bubble-position.html

    r106438 r106801  
    99
    1010function onSpeechChange() {
    11     debug("onSpeechChange()");
     11    // Since we requested dumpRect, the rect comes back as the speech result.
     12    var rect = input.value.split(',');
     13    var x = parseInt(rect[0]);
     14    var y = parseInt(rect[1]);
    1215
    13     // Since we requested dumpRect, the rect comes back as the speech result.
    14     window.expectedString = expectedX + "," + expectedY + "," + expectedWidth + "," + expectedHeight;
    15     shouldBeTrue("input.value === expectedString");
     16    // Check that the rect is inside the iframe.
     17    if (x >= iframe.offsetLeft && x <= iframe.offsetLeft + iframe.offsetWidth
     18            && y >= iframe.offsetTop && y <= iframe.offsetTop + iframe.offsetHeight)
     19        testPassed("rect is inside the iframe");
     20    else
     21        testFailed("FAIL: rect was outside the iframe. Actual rect.x: " + x + ", rect.y: " + y);
     22
    1623    finishJSTest();
    1724}
     
    2330    input.onwebkitspeechchange = onSpeechChange;
    2431    iframe.contentDocument.getElementsByTagName('body')[0].appendChild(input);
    25 
    26     window.expectedWidth = input.scrollHeight;
    27     window.expectedHeight = input.scrollHeight;
    28     window.expectedX = iframe.offsetLeft + input.offsetLeft + input.offsetWidth - expectedWidth;
    29     window.expectedY = iframe.offsetTop + input.offsetTop + input.offsetHeight - 1;
    3032
    3133    if (window.layoutTestController && window.eventSender) {
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r106797 r106801  
    40254025BUGWK77534 LINUX : plugins/createScriptableObject-before-start.html = PASS MISSING
    40264026
    4027 BUGWK77641 MAC : fast/speech/bubble-position.html = TEXT
    4028 
    40294027BUGWK77661 WIN LINUX : http/tests/inspector/indexeddb/database-structure.html = TEXT
    40304028
Note: See TracChangeset for help on using the changeset viewer.