| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 chrome.test.getConfig(function(config) { | 5 chrome.test.getConfig(function(config) { |
| 6 var LOCAL_URL = 'local-iframe.html'; | 6 var LOCAL_URL = 'local-iframe.html'; |
| 7 var DATA_URL = 'data:text/plain,This frame should be displayed.'; | 7 var DATA_URL = 'data:text/plain,This frame should be displayed.'; |
| 8 var REMOTE_URL = 'http://localhost:' + config.testServer.port | 8 var REMOTE_URL = 'http://localhost:' + config.testServer.port |
| 9 '/extensions/platform_apps/iframes/remote-iframe.html'; | 9 '/extensions/platform_apps/iframes/remote-iframe.html'; |
| 10 var EXTENSION_URL = 'chrome-extension://bflfoohhdbcfojbnfcnjpifhimomlgmp/newta
b.html' |
| 10 | 11 |
| 11 chrome.test.runTests([ | 12 chrome.test.runTests([ |
| 12 function localIframe() { | 13 function localIframe() { |
| 13 var iframe = document.createElement('iframe'); | 14 var iframe = document.createElement('iframe'); |
| 14 iframe.onload = chrome.test.callbackPass(function() { | 15 iframe.onload = chrome.test.callbackPass(function() { |
| 15 console.log('Local iframe loaded'); | 16 console.log('Local iframe loaded'); |
| 16 }); | 17 }); |
| 17 iframe.src = LOCAL_URL; | 18 iframe.src = LOCAL_URL; |
| 18 document.body.appendChild(iframe); | 19 document.body.appendChild(iframe); |
| 19 }, | 20 }, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 }, | 71 }, |
| 71 | 72 |
| 72 function remoteIframe() { | 73 function remoteIframe() { |
| 73 var iframe = document.createElement('iframe'); | 74 var iframe = document.createElement('iframe'); |
| 74 iframe.src = REMOTE_URL; | 75 iframe.src = REMOTE_URL; |
| 75 document.body.appendChild(iframe); | 76 document.body.appendChild(iframe); |
| 76 | 77 |
| 77 // Load failure should happen synchronously, but wait a bit before | 78 // Load failure should happen synchronously, but wait a bit before |
| 78 // declaring success. | 79 // declaring success. |
| 79 setTimeout(chrome.test.succeed, 500); | 80 setTimeout(chrome.test.succeed, 500); |
| 81 }, |
| 82 |
| 83 function extensionIframe() { |
| 84 var iframe = document.createElement('iframe'); |
| 85 iframe.src = EXTENSION_URL; |
| 86 document.body.appendChild(iframe); |
| 87 |
| 88 // Load failure should happen synchronously, but wait a bit before |
| 89 // declaring success. |
| 90 setTimeout(chrome.test.succeed, 500); |
| 80 } | 91 } |
| 92 |
| 81 ]); | 93 ]); |
| 82 }); | 94 }); |
| OLD | NEW |