2010-01-06 Ojan Vafai <ojan@chromium.org>
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jan 2010 00:24:56 +0000 (00:24 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jan 2010 00:24:56 +0000 (00:24 +0000)
        Reviewed by Eric Seidel.

        fast/css/transition-color-unspecified.html and fast/dom/HTMLObjectElement/object-as-frame.html are flaky
        https://bugs.webkit.org/show_bug.cgi?id=33270

        These both rely on setTimeouts where they should be using events.

        * fast/css/transition-color-unspecified.html:
        * fast/dom/HTMLObjectElement/object-as-frame.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@52879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/css/transition-color-unspecified.html
LayoutTests/fast/dom/HTMLObjectElement/object-as-frame.html

index 44d6b9b..aa86aa8 100644 (file)
@@ -2,6 +2,18 @@
 
         Reviewed by Eric Seidel.
 
+        fast/css/transition-color-unspecified.html and fast/dom/HTMLObjectElement/object-as-frame.html are flaky
+        https://bugs.webkit.org/show_bug.cgi?id=33270
+
+        These both rely on setTimeouts where they should be using events.
+
+        * fast/css/transition-color-unspecified.html:
+        * fast/dom/HTMLObjectElement/object-as-frame.html:
+
+2010-01-06  Ojan Vafai  <ojan@chromium.org>
+
+        Reviewed by Eric Seidel.
+
         platform/chromium/fast/dom/interval.html is flaky
         https://bugs.webkit.org/show_bug.cgi?id=33274
 
index 9595829..1634dee 100644 (file)
@@ -8,7 +8,11 @@
 <script>
     if (window.layoutTestController)
         layoutTestController.waitUntilDone();
+
+    document.getElementById("test").addEventListener('webkitTransitionEnd', function() {
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }, false);
+
     document.getElementById("test").className = "";
-    if (window.layoutTestController)
-        setTimeout("layoutTestController.notifyDone()", 100);
 </script>
index 25da162..034a3d8 100644 (file)
@@ -18,15 +18,24 @@ function runTests()
     shouldBe("window.frames.length", "2");
     shouldBe("window.frames[0].frameElement.name", '"frame"');
     shouldBe("window.frames[1].frameElement.name", '"obj"');
+
+    document.getElementsByName('frame')[0].onload = handleLoad;
+    document.getElementsByName('obj')[0].onload = handleLoad;
+
     debug("Loading '" + updatedFrameURL + "' in iframe...");
     debug("Loading '" + updatedObjectURL + "' in object...");
     open(updatedFrameURL, "frame");
     open(updatedObjectURL, "obj");
-    setTimeout("runMoreTests()", 200);
 }
 
-function runMoreTests()
+var numLoads = 0;
+
+function handleLoad()
 {
+    numLoads++;
+    if (numLoads < 2)
+        return;
     shouldBe("window.frames[0].location.toString()", '"' + updatedFrameURL + '"');
     shouldBe("window.frames[1].location.toString()", '"' + updatedObjectURL + '"');
     if (window.layoutTestController) {