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 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1969 }); | 1969 }); |
1970 document.body.appendChild(webview); | 1970 document.body.appendChild(webview); |
1971 } | 1971 } |
1972 | 1972 |
1973 // This test verifies that the loadabort event fires when loading a webview | 1973 // This test verifies that the loadabort event fires when loading a webview |
1974 // accessible resource from a partition that is not privileged. | 1974 // accessible resource from a partition that is not privileged. |
1975 function testLoadAbortChromeExtensionURLWrongPartition() { | 1975 function testLoadAbortChromeExtensionURLWrongPartition() { |
1976 var localResource = chrome.runtime.getURL('guest.html'); | 1976 var localResource = chrome.runtime.getURL('guest.html'); |
1977 var webview = document.createElement('webview'); | 1977 var webview = document.createElement('webview'); |
1978 webview.addEventListener('loadabort', function(e) { | 1978 webview.addEventListener('loadabort', function(e) { |
1979 embedder.test.assertEq(-109, e.code); | 1979 embedder.test.assertEq(-20, e.code); |
1980 embedder.test.assertEq('ERR_ADDRESS_UNREACHABLE', e.reason); | 1980 embedder.test.assertEq('ERR_BLOCKED_BY_CLIENT', e.reason); |
1981 embedder.test.succeed(); | 1981 embedder.test.succeed(); |
1982 }); | 1982 }); |
1983 webview.addEventListener('loadstop', function(e) { | 1983 webview.addEventListener('loadstop', function(e) { |
1984 embedder.test.fail(); | 1984 embedder.test.fail(); |
1985 }); | 1985 }); |
1986 webview.setAttribute('src', localResource); | 1986 webview.setAttribute('src', localResource); |
1987 document.body.appendChild(webview); | 1987 document.body.appendChild(webview); |
1988 } | 1988 } |
1989 | 1989 |
1990 // This test verifies that the loadabort event fires as expected and with the | 1990 // This test verifies that the loadabort event fires as expected and with the |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3069 'testRendererNavigationRedirectWhileUnattached': | 3069 'testRendererNavigationRedirectWhileUnattached': |
3070 testRendererNavigationRedirectWhileUnattached | 3070 testRendererNavigationRedirectWhileUnattached |
3071 }; | 3071 }; |
3072 | 3072 |
3073 onload = function() { | 3073 onload = function() { |
3074 chrome.test.getConfig(function(config) { | 3074 chrome.test.getConfig(function(config) { |
3075 embedder.setUp_(config); | 3075 embedder.setUp_(config); |
3076 chrome.test.sendMessage("Launched"); | 3076 chrome.test.sendMessage("Launched"); |
3077 }); | 3077 }); |
3078 }; | 3078 }; |
OLD | NEW |