source: webkit/trunk/LayoutTests/fast/dom/resources/replaceChildHelper.html

Last change on this file was 94648, checked in by commit-queue@webkit.org, 13 years ago

fast/dom/replaceChild.html may not test what it's supposed to test and may sometimes be flaky
https://bugs.webkit.org/show_bug.cgi?id=67629

Patch by Xianzhu Wang <wangxianzhu@chromium.org> on 2011-09-07
Reviewed by Darin Adler.

The test is supposed to test Node.replaceChild() called from a frame.
However, in most cases, it's not executed because the test finishes before
the iframe's onload event handler. For now, the expected result is just
the original render tree before replaceChild(). In chance that iframe's
onload is executed earlier, the actual result might be different from
expected (that is, replaceChild() is executed and the DOM is actually changed.)

Use waitUntilDone() and notifyDone() to ensure the frame's onload handler
is called.

BTW changed it to a pure text test to avoid platform branches.

  • fast/dom/replaceChild.html:
  • fast/dom/replaceChild-expected.txt: Added.
  • fast/dom/resources/replaceChildHelper.html:
  • platform/chromium-linux/fast/dom/replaceChild-expected.png: Removed.
  • platform/chromium-mac/fast/dom/replaceChild-expected.png: Removed.
  • platform/chromium-win/fast/dom/replaceChild-expected.png: Removed.
  • platform/chromium-win/fast/dom/replaceChild-expected.txt: Removed.
  • platform/gtk/fast/dom/replaceChild-expected.png: Removed.
  • platform/gtk/fast/dom/replaceChild-expected.txt: Removed.
  • platform/mac-leopard/fast/dom/replaceChild-expected.png: Removed.
  • platform/mac/fast/dom/replaceChild-expected.png: Removed.
  • platform/mac/fast/dom/replaceChild-expected.txt: Removed.
  • platform/qt/fast/dom/replaceChild-expected.png: Removed.
  • platform/qt/fast/dom/replaceChild-expected.txt: Removed.
  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/html
File size: 672 bytes
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5<title>menu window</title>
6<script language="javascript" type="text/javascript">
7        function doLoad(){
8                if(window.parent){
9                        var menu = document.getElementById("menu").cloneNode(true);
10                        parent.loadMenu(menu);
11                }
12        }
13        window.onload = doLoad;
14</script>
15</head>
16<body>
17        <div id="menu">
18                <div>test 1</div>
19                <div>test 2</div>
20        </div>
21        FAIL (This test may fail in a real browser due to security restrictions)
22</body>
23</html>
24
Note: See TracBrowser for help on using the repository browser.