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 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2952 // 'about:blank'. | 2952 // 'about:blank'. |
2953 embedder.test.assertFalse(webview.src == 'about:blank'); | 2953 embedder.test.assertFalse(webview.src == 'about:blank'); |
2954 embedder.test.succeed(); | 2954 embedder.test.succeed(); |
2955 }; | 2955 }; |
2956 webview.executeScript({code:'document.getElementById("mailto").click()'}); | 2956 webview.executeScript({code:'document.getElementById("mailto").click()'}); |
2957 }; | 2957 }; |
2958 | 2958 |
2959 document.body.appendChild(webview); | 2959 document.body.appendChild(webview); |
2960 } | 2960 } |
2961 | 2961 |
2962 // This test verifies that mailto links are enabled. | |
Charlie Reis
2016/10/04 19:54:36
nit: Stale comment.
alexmos
2016/10/04 20:01:59
Done.
| |
2963 function testBlobURL() { | |
2964 var webview = new WebView(); | |
2965 var blob = new Blob(['<html><body>Blob content</body></html>'], | |
2966 {type: 'text/html'}); | |
2967 var blobURL = URL.createObjectURL(blob); | |
2968 webview.src = blobURL; | |
2969 | |
2970 webview.onloadabort = function() { | |
2971 // The blob: URL load should not trigger a loadabort. | |
2972 window.console.log('Blob URL load was aborted.'); | |
2973 embedder.test.fail(); | |
2974 }; | |
2975 webview.onloadstop = function() { | |
2976 embedder.test.assertTrue(webview.src == blobURL); | |
2977 embedder.test.succeed(); | |
2978 }; | |
2979 | |
2980 document.body.appendChild(webview); | |
2981 } | |
2982 | |
2962 // This test navigates an unattached guest to 'about:blank', then it makes a | 2983 // This test navigates an unattached guest to 'about:blank', then it makes a |
2963 // renderer/ navigation to a URL that results in a server side redirect. In the | 2984 // renderer/ navigation to a URL that results in a server side redirect. In the |
2964 // end we verify that the redirected URL loads in the guest properly. | 2985 // end we verify that the redirected URL loads in the guest properly. |
2965 function testRendererNavigationRedirectWhileUnattached() { | 2986 function testRendererNavigationRedirectWhileUnattached() { |
2966 var webview = document.createElement('webview'); | 2987 var webview = document.createElement('webview'); |
2967 // So that |webview| is unattached, but can navigate. | 2988 // So that |webview| is unattached, but can navigate. |
2968 webview.style.display = 'none'; | 2989 webview.style.display = 'none'; |
2969 | 2990 |
2970 var seenRedirectURLCommit = false; | 2991 var seenRedirectURLCommit = false; |
2971 var seenRedirectLoadStop = false; | 2992 var seenRedirectLoadStop = false; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3108 'testPerViewZoomMode': testPerViewZoomMode, | 3129 'testPerViewZoomMode': testPerViewZoomMode, |
3109 'testDisabledZoomMode': testDisabledZoomMode, | 3130 'testDisabledZoomMode': testDisabledZoomMode, |
3110 'testZoomBeforeNavigation': testZoomBeforeNavigation, | 3131 'testZoomBeforeNavigation': testZoomBeforeNavigation, |
3111 'testPlugin': testPlugin, | 3132 'testPlugin': testPlugin, |
3112 'testGarbageCollect': testGarbageCollect, | 3133 'testGarbageCollect': testGarbageCollect, |
3113 'testCloseNewWindowCleanup': testCloseNewWindowCleanup, | 3134 'testCloseNewWindowCleanup': testCloseNewWindowCleanup, |
3114 'testFocusWhileFocused': testFocusWhileFocused, | 3135 'testFocusWhileFocused': testFocusWhileFocused, |
3115 'testPDFInWebview': testPDFInWebview, | 3136 'testPDFInWebview': testPDFInWebview, |
3116 'testMailtoLink': testMailtoLink, | 3137 'testMailtoLink': testMailtoLink, |
3117 'testRendererNavigationRedirectWhileUnattached': | 3138 'testRendererNavigationRedirectWhileUnattached': |
3118 testRendererNavigationRedirectWhileUnattached | 3139 testRendererNavigationRedirectWhileUnattached, |
3140 'testBlobURL': testBlobURL | |
3119 }; | 3141 }; |
3120 | 3142 |
3121 onload = function() { | 3143 onload = function() { |
3122 chrome.test.getConfig(function(config) { | 3144 chrome.test.getConfig(function(config) { |
3123 embedder.setUp_(config); | 3145 embedder.setUp_(config); |
3124 chrome.test.sendMessage("Launched"); | 3146 chrome.test.sendMessage("Launched"); |
3125 }); | 3147 }); |
3126 }; | 3148 }; |
OLD | NEW |