Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / frames / srcdoc / removing-srcdoc-loads-src.html
blob7f7b3137bef00ed1f74948ca233e7b0b1c04f60e
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <body>
5 <script>
6 async_test(function(t) {
7 var iframe = document.createElement('iframe');
8 iframe.src = 'resources/doc.html';
9 iframe.srcdoc = 'Set by srcdoc.';
10 iframe.onload = t.step_func(srcdocLoaded);
11 document.body.appendChild(iframe);
13 function srcdocLoaded() {
14 assert_equals(
15 iframe.contentDocument.documentElement.textContent,
16 'Set by srcdoc.',
17 'srcdoc should override src when both are present');
18 iframe.onload = t.step_func(srcLoaded);
19 iframe.removeAttribute('srcdoc');
22 function srcLoaded() {
23 assert_equals(
24 iframe.contentDocument.documentElement.textContent,
25 'Hello, world.\n',
26 'when srcdoc is removed, src should be loaded');
27 t.done();
29 }, 'Removing an iframe srcdoc attribute should load the src, if set');
30 </script>