| 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 var util = {}; | 5 var util = {}; |
| 6 var embedder = {}; | 6 var embedder = {}; |
| 7 embedder.baseGuestURL = ''; | 7 embedder.baseGuestURL = ''; |
| 8 embedder.emptyGuestURL = ''; | 8 embedder.emptyGuestURL = ''; |
| 9 embedder.windowOpenGuestURL = ''; | 9 embedder.windowOpenGuestURL = ''; |
| 10 embedder.noReferrerGuestURL = ''; | 10 embedder.noReferrerGuestURL = ''; |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 }; | 743 }; |
| 744 webview.addEventListener('loadstop', loadstopHandler); | 744 webview.addEventListener('loadstop', loadstopHandler); |
| 745 | 745 |
| 746 webview.setAttribute('src', 'data:text/html,<html><body>guest</body></html>'); | 746 webview.setAttribute('src', 'data:text/html,<html><body>guest</body></html>'); |
| 747 } | 747 } |
| 748 | 748 |
| 749 function testExecuteScriptFail() { | 749 function testExecuteScriptFail() { |
| 750 var webview = document.createElement('webview'); | 750 var webview = document.createElement('webview'); |
| 751 document.body.appendChild(webview); | 751 document.body.appendChild(webview); |
| 752 setTimeout(function() { | 752 setTimeout(function() { |
| 753 try { | |
| 754 webview.executeScript( | 753 webview.executeScript( |
| 755 {code:'document.body.style.backgroundColor = "red";'}, | 754 {code:'document.body.style.backgroundColor = "red";'}, |
| 756 function(results) { | 755 function(results) { |
| 757 embedder.test.fail(); | 756 embedder.test.fail(); |
| 758 }); | 757 }); |
| 759 } catch (e) { | 758 setTimeout(function() { |
| 760 embedder.test.succeed(); | 759 embedder.test.succeed(); |
| 761 } | 760 }, 0); |
| 762 }, 0); | 761 }, 0); |
| 763 } | 762 } |
| 764 | 763 |
| 765 function testExecuteScript() { | 764 function testExecuteScript() { |
| 766 var webview = document.createElement('webview'); | 765 var webview = document.createElement('webview'); |
| 767 webview.setAttribute('partition', arguments.callee.name); | 766 webview.setAttribute('partition', arguments.callee.name); |
| 768 webview.addEventListener('loadstop', function() { | 767 webview.addEventListener('loadstop', function() { |
| 769 webview.executeScript( | 768 webview.executeScript( |
| 770 {code:'document.body.style.backgroundColor = "red";'}, | 769 {code:'document.body.style.backgroundColor = "red";'}, |
| 771 function(results) { | 770 function(results) { |
| (...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2060 'testFindAPI_findupdate': testFindAPI, | 2059 'testFindAPI_findupdate': testFindAPI, |
| 2061 'testLoadDataAPI': testLoadDataAPI | 2060 'testLoadDataAPI': testLoadDataAPI |
| 2062 }; | 2061 }; |
| 2063 | 2062 |
| 2064 onload = function() { | 2063 onload = function() { |
| 2065 chrome.test.getConfig(function(config) { | 2064 chrome.test.getConfig(function(config) { |
| 2066 embedder.setUp_(config); | 2065 embedder.setUp_(config); |
| 2067 chrome.test.sendMessage("Launched"); | 2066 chrome.test.sendMessage("Launched"); |
| 2068 }); | 2067 }); |
| 2069 }; | 2068 }; |
| OLD | NEW |