Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Document / title-property-set-multiple-times.html
blob4933fa8e646ee7825749a63c145d865a29cb5bab
1 <html>
2 <head>
3 <script>
4 function log(message)
6 var paragraph = document.createElement("p");
7 paragraph.appendChild(document.createTextNode(message));
8 document.getElementById("console").appendChild(paragraph);
11 function expect(expected, actual)
13 var msg = "Expected " + expected + ", got " + actual + ": ";
14 if (expected == actual)
15 log(msg + "PASS");
16 else
17 log(msg + "FAIL");
20 function createTitleElement(title)
22 var t = document.createElement('title');
23 t.appendChild(document.createTextNode(title));
24 return t;
27 function test()
29 if (window.testRunner)
30 testRunner.dumpAsText();
32 var head = document.getElementsByTagName('head')[0];
34 expect('', document.title);
35 head.appendChild(createTitleElement('First title'));
36 expect('First title', document.title);
37 document.title = 'Second title';
38 expect('Second title', document.title);
39 head.appendChild(createTitleElement('Third title'));
40 expect('Second title', document.title);
41 document.title = 'Fourth title';
42 expect('Fourth title', document.title);
44 var titles = head.getElementsByTagName('title');
45 var expectedTitles = {1: 'Third title', 0: ''};
46 while (titles.length) {
47 titles[0].parentNode.removeChild(titles[0]);
48 expect(expectedTitles[titles.length], document.title);
51 head.appendChild(createTitleElement('Fifth title'));
52 expect('Fifth title', document.title);
54 </script>
55 </head>
56 <body>
57 <p>Test for <a href='http://bugs.webkit.org/show_bug.cgi?id=11692'>http://bugs.webkit.org/show_bug.cgi?id=11692</a>.
58 If the title has been explicitly set via document.title, any further &lt;title&gt; tags parsed should not effect
59 the document title.</p>
60 <hr>
61 <div id='console'/>
62 <script>
63 test();
64 </script>
65 </body>
66 </html>