Title: [106801] trunk/LayoutTests
Revision
106801
Author
[email protected]
Date
2012-02-06 05:24:20 -0800 (Mon, 06 Feb 2012)

Log 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (106800 => 106801)


--- trunk/LayoutTests/ChangeLog	2012-02-06 13:11:50 UTC (rev 106800)
+++ trunk/LayoutTests/ChangeLog	2012-02-06 13:24:20 UTC (rev 106801)
@@ -1,3 +1,18 @@
+2012-02-03  Hans Wennborg  <[email protected]>
+
+        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:
+
 2012-02-06  Allan Sandfeld Jensen  <[email protected]>
 
         Test that timers do not fire from subframes of suspended documents.

Modified: trunk/LayoutTests/fast/speech/bubble-position-expected.txt (106800 => 106801)


--- trunk/LayoutTests/fast/speech/bubble-position-expected.txt	2012-02-06 13:11:50 UTC (rev 106800)
+++ trunk/LayoutTests/fast/speech/bubble-position-expected.txt	2012-02-06 13:24:20 UTC (rev 106801)
@@ -4,8 +4,7 @@
 
 
 Clicking the speech button.
-onSpeechChange()
-PASS input.value === expectedString is true
+PASS rect is inside the iframe
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/speech/bubble-position.html (106800 => 106801)


--- trunk/LayoutTests/fast/speech/bubble-position.html	2012-02-06 13:11:50 UTC (rev 106800)
+++ trunk/LayoutTests/fast/speech/bubble-position.html	2012-02-06 13:24:20 UTC (rev 106801)
@@ -8,11 +8,18 @@
 description('Tests for speech button click with &lt;input type="text" speech>.');
 
 function onSpeechChange() {
-    debug("onSpeechChange()");
+    // Since we requested dumpRect, the rect comes back as the speech result.
+    var rect = input.value.split(',');
+    var x = parseInt(rect[0]);
+    var y = parseInt(rect[1]);
 
-    // Since we requested dumpRect, the rect comes back as the speech result.
-    window.expectedString = expectedX + "," + expectedY + "," + expectedWidth + "," + expectedHeight;
-    shouldBeTrue("input.value === expectedString");
+    // Check that the rect is inside the iframe.
+    if (x >= iframe.offsetLeft && x <= iframe.offsetLeft + iframe.offsetWidth
+            && y >= iframe.offsetTop && y <= iframe.offsetTop + iframe.offsetHeight)
+        testPassed("rect is inside the iframe");
+    else
+        testFailed("FAIL: rect was outside the iframe. Actual rect.x: " + x + ", rect.y: " + y);
+
     finishJSTest();
 }
 
@@ -23,11 +30,6 @@
     input._onwebkitspeechchange_ = onSpeechChange;
     iframe.contentDocument.getElementsByTagName('body')[0].appendChild(input);
 
-    window.expectedWidth = input.scrollHeight;
-    window.expectedHeight = input.scrollHeight;
-    window.expectedX = iframe.offsetLeft + input.offsetLeft + input.offsetWidth - expectedWidth;
-    window.expectedY = iframe.offsetTop + input.offsetTop + input.offsetHeight - 1;
-
     if (window.layoutTestController && window.eventSender) {
         layoutTestController.setMockSpeechInputDumpRect(true);
 

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (106800 => 106801)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-02-06 13:11:50 UTC (rev 106800)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-02-06 13:24:20 UTC (rev 106801)
@@ -4024,8 +4024,6 @@
 
 BUGWK77534 LINUX : plugins/createScriptableObject-before-start.html = PASS MISSING
 
-BUGWK77641 MAC : fast/speech/bubble-position.html = TEXT
-
 BUGWK77661 WIN LINUX : http/tests/inspector/indexeddb/database-structure.html = TEXT
 
 // Hitting ASSERT_NOT_REACHED in EventHandler::handleTouchEvent() as of r106554.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to