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 124d26cfb9aa6aa83a2fe431a2f2b030ba5b75a6..2e2a6fd4d1610d1a604e2b7ea200e05fad98633d 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 |
@@ -336,6 +336,25 @@ function testChromeExtensionRelativePath() { |
document.body.appendChild(webview); |
} |
+// Makes sure inline scripts works inside guest that was loaded from |
+// accessible_resources. |
+function testInlineScriptFromAccessibleResources() { |
+ var webview = document.createElement('webview'); |
+ // foobar is a privileged partition according to the manifest file. |
+ webview.partition = 'foobar'; |
+ webview.addEventListener('loadabort', function(e) { |
+ embedder.test.fail(); |
+ }); |
+ webview.addEventListener('consolemessage', function(e) { |
+ window.console.log('consolemessage: ' + e.message); |
+ if (e.message == 'guest.html: Inline script ran') { |
+ embedder.test.succeed(); |
+ } |
+ }); |
+ webview.setAttribute('src', 'guest.html'); |
+ document.body.appendChild(webview); |
+} |
+ |
// This tests verifies that webview fires a loadabort event instead of crashing |
// the browser if we attempt to navigate to a chrome-extension: URL with an |
// extension ID that does not exist. |
@@ -1502,6 +1521,8 @@ embedder.test.testList = { |
'testAPIMethodExistence': testAPIMethodExistence, |
'testChromeExtensionURL': testChromeExtensionURL, |
'testChromeExtensionRelativePath': testChromeExtensionRelativePath, |
+ 'testInlineScriptFromAccessibleResources': |
+ testInlineScriptFromAccessibleResources, |
'testInvalidChromeExtensionURL': testInvalidChromeExtensionURL, |
'testWebRequestAPIExistence': testWebRequestAPIExistence, |
'testEventName': testEventName, |