<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>132230</bug_id>
          
          <creation_ts>2014-04-27 08:15:38 -0700</creation_ts>
          <short_desc>LayoutTests/editing/execCommand/12244.html passes, but is actually failing</short_desc>
          <delta_ts>2014-04-28 04:33:11 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>ayg</cc>
    
    <cc>justin.garcia</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1004406</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2014-04-27 08:15:38 -0700</bug_when>
    <thetext>LayoutTests/editing/execCommand/12244.html was added by Bug 12244 in r20071.

However, it calls setTimeout() without calling waitUntilDone()/notifyDone(), so it doesn&apos;t actually test window.find() because the test ends before the runTest() method is called.

Adding waitUntilDone()/notifyDone():

diff --git a/LayoutTests/editing/execCommand/12244.html b/LayoutTests/editing/execCommand/12244.html
index 73660c3..af4800e 100644
--- a/LayoutTests/editing/execCommand/12244.html
+++ b/LayoutTests/editing/execCommand/12244.html
@@ -1,3 +1,5 @@
+&lt;html&gt;
+&lt;body&gt;
 This is a test for window.find().
 &lt;br&gt;&lt;br&gt;
 Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and ded
@@ -19,12 +21,18 @@ function assert(expected, actual, error)
 }
 
 function runTest() {
-    assert(window.find(&quot;now we are&quot;), true, &quot;&apos;now we are&apos; wasn&apos;t found&quot;);
-        assert(window.find(), true, &quot;&apos;now we are&apos; wasn&apos;t found&quot;);
+    assert(window.find(&quot;now we are&quot;, false), true, &quot;&apos;now we are&apos; wasn&apos;t found&quot;);
+    assert(window.find(), true, &quot;&apos;now we are&apos; wasn&apos;t found&quot;);
+    if (window.testRunner) {
+        window.testRunner.notifyDone();
+    }
 }
 if (window.testRunner) {
     window.testRunner.dumpEditingCallbacks();
     window.testRunner.dumpAsText();
+    window.testRunner.waitUntilDone();
 }
 window.setTimeout(runTest, 100);
 &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;

Causes the test to fail:

--- /tmp/layout-test-results-X/editing/execCommand/12244-expected.txt
+++ /tmp/layout-test-results-X/editing/execCommand/12244-actual.txt
@@ -1,6 +1,7 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 This is a test for window.find(). 
 
 Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal. 
 
 Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.
-
+Error: &apos;now we are&apos; wasn&apos;t found</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1004542</commentid>
    <comment_count>1</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2014-04-28 04:33:11 -0700</bug_when>
    <thetext>FWIW, at Mozilla we changed mochitests to fail if they run no asserts, and caught a number of cases like this where nothing was actually being tested due to a test bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=735805</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>