| 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 2895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2906 // 'about:blank'. | 2906 // 'about:blank'. |
| 2907 embedder.test.assertFalse(webview.src == 'about:blank'); | 2907 embedder.test.assertFalse(webview.src == 'about:blank'); |
| 2908 embedder.test.succeed(); | 2908 embedder.test.succeed(); |
| 2909 }; | 2909 }; |
| 2910 webview.executeScript({code:'document.getElementById("mailto").click()'}); | 2910 webview.executeScript({code:'document.getElementById("mailto").click()'}); |
| 2911 }; | 2911 }; |
| 2912 | 2912 |
| 2913 document.body.appendChild(webview); | 2913 document.body.appendChild(webview); |
| 2914 } | 2914 } |
| 2915 | 2915 |
| 2916 // This test verifies that an embedder can navigate a WebView to a blob URL it |
| 2917 // creates. |
| 2918 function testBlobURL() { |
| 2919 var webview = new WebView(); |
| 2920 var blob = new Blob(['<html><body>Blob content</body></html>'], |
| 2921 {type: 'text/html'}); |
| 2922 var blobURL = URL.createObjectURL(blob); |
| 2923 webview.src = blobURL; |
| 2924 |
| 2925 webview.onloadabort = function() { |
| 2926 // The blob: URL load should not trigger a loadabort. |
| 2927 window.console.log('Blob URL load was aborted.'); |
| 2928 embedder.test.fail(); |
| 2929 }; |
| 2930 webview.onloadstop = function() { |
| 2931 embedder.test.assertTrue(webview.src == blobURL); |
| 2932 embedder.test.succeed(); |
| 2933 }; |
| 2934 |
| 2935 document.body.appendChild(webview); |
| 2936 } |
| 2937 |
| 2916 // This test navigates an unattached guest to 'about:blank', then it makes a | 2938 // This test navigates an unattached guest to 'about:blank', then it makes a |
| 2917 // renderer/ navigation to a URL that results in a server side redirect. In the | 2939 // renderer/ navigation to a URL that results in a server side redirect. In the |
| 2918 // end we verify that the redirected URL loads in the guest properly. | 2940 // end we verify that the redirected URL loads in the guest properly. |
| 2919 function testRendererNavigationRedirectWhileUnattached() { | 2941 function testRendererNavigationRedirectWhileUnattached() { |
| 2920 var webview = document.createElement('webview'); | 2942 var webview = document.createElement('webview'); |
| 2921 // So that |webview| is unattached, but can navigate. | 2943 // So that |webview| is unattached, but can navigate. |
| 2922 webview.style.display = 'none'; | 2944 webview.style.display = 'none'; |
| 2923 | 2945 |
| 2924 var seenRedirectURLCommit = false; | 2946 var seenRedirectURLCommit = false; |
| 2925 var seenRedirectLoadStop = false; | 2947 var seenRedirectLoadStop = false; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3060 'testPerViewZoomMode': testPerViewZoomMode, | 3082 'testPerViewZoomMode': testPerViewZoomMode, |
| 3061 'testDisabledZoomMode': testDisabledZoomMode, | 3083 'testDisabledZoomMode': testDisabledZoomMode, |
| 3062 'testZoomBeforeNavigation': testZoomBeforeNavigation, | 3084 'testZoomBeforeNavigation': testZoomBeforeNavigation, |
| 3063 'testPlugin': testPlugin, | 3085 'testPlugin': testPlugin, |
| 3064 'testGarbageCollect': testGarbageCollect, | 3086 'testGarbageCollect': testGarbageCollect, |
| 3065 'testCloseNewWindowCleanup': testCloseNewWindowCleanup, | 3087 'testCloseNewWindowCleanup': testCloseNewWindowCleanup, |
| 3066 'testFocusWhileFocused': testFocusWhileFocused, | 3088 'testFocusWhileFocused': testFocusWhileFocused, |
| 3067 'testPDFInWebview': testPDFInWebview, | 3089 'testPDFInWebview': testPDFInWebview, |
| 3068 'testMailtoLink': testMailtoLink, | 3090 'testMailtoLink': testMailtoLink, |
| 3069 'testRendererNavigationRedirectWhileUnattached': | 3091 'testRendererNavigationRedirectWhileUnattached': |
| 3070 testRendererNavigationRedirectWhileUnattached | 3092 testRendererNavigationRedirectWhileUnattached, |
| 3093 'testBlobURL': testBlobURL |
| 3071 }; | 3094 }; |
| 3072 | 3095 |
| 3073 onload = function() { | 3096 onload = function() { |
| 3074 chrome.test.getConfig(function(config) { | 3097 chrome.test.getConfig(function(config) { |
| 3075 embedder.setUp_(config); | 3098 embedder.setUp_(config); |
| 3076 chrome.test.sendMessage("Launched"); | 3099 chrome.test.sendMessage("Launched"); |
| 3077 }); | 3100 }); |
| 3078 }; | 3101 }; |
| OLD | NEW |