Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8436)

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/shim/main.js

Issue 2387323002: Fix blob URL blocking for apps that use <webview>. (Closed)
Patch Set: Fix comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/chrome_extensions_network_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/platform_apps/web_view/shim/main.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
index 3709a1b2cfda0d323fb30c38d906901d1fd785f2..2a4ccb3b825e51a0416104404badf13fab2d59dc 100644
--- a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
+++ b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
@@ -2959,6 +2959,28 @@ function testMailtoLink() {
document.body.appendChild(webview);
}
+// This test verifies that an embedder can navigate a WebView to a blob URL it
+// creates.
+function testBlobURL() {
+ var webview = new WebView();
+ var blob = new Blob(['<html><body>Blob content</body></html>'],
+ {type: 'text/html'});
+ var blobURL = URL.createObjectURL(blob);
+ webview.src = blobURL;
+
+ webview.onloadabort = function() {
+ // The blob: URL load should not trigger a loadabort.
+ window.console.log('Blob URL load was aborted.');
+ embedder.test.fail();
+ };
+ webview.onloadstop = function() {
+ embedder.test.assertTrue(webview.src == blobURL);
+ embedder.test.succeed();
+ };
+
+ document.body.appendChild(webview);
+}
+
// This test navigates an unattached guest to 'about:blank', then it makes a
// renderer/ navigation to a URL that results in a server side redirect. In the
// end we verify that the redirected URL loads in the guest properly.
@@ -3115,7 +3137,8 @@ embedder.test.testList = {
'testPDFInWebview': testPDFInWebview,
'testMailtoLink': testMailtoLink,
'testRendererNavigationRedirectWhileUnattached':
- testRendererNavigationRedirectWhileUnattached
+ testRendererNavigationRedirectWhileUnattached,
+ 'testBlobURL': testBlobURL
};
onload = function() {
« no previous file with comments | « chrome/browser/net/chrome_extensions_network_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698