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

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

Issue 11968054: <webview>: Implement ExecuteScript (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 7 years, 11 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
Index: chrome/test/data/extensions/platform_apps/web_view/main.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/main.js b/chrome/test/data/extensions/platform_apps/web_view/main.js
index d17f7bd0450a4a1d1d9a8aba35549a7118a73188..4589acb0a9d30fa95b6027baf23cfe65661132e0 100644
--- a/chrome/test/data/extensions/platform_apps/web_view/main.js
+++ b/chrome/test/data/extensions/platform_apps/web_view/main.js
@@ -205,6 +205,21 @@ onload = function() {
chrome.test.succeed();
}
}, 0);
+ },
+
+ function webViewExecuteScript() {
+ var webview = document.createElement('webview');
+ webview.addEventListener('loadstop', function() {
+ webview.executeScript(
+ {code:'document.body.style.backgroundColor = "red";'},
+ function(results) {
+ chrome.test.assertEq(1, results.length);
+ chrome.test.assertEq('red', results[0]);
+ chrome.test.succeed();
+ });
+ });
+ webview.setAttribute('src', 'data:text/html,trigger navigation');
+ document.body.appendChild(webview);
}
]);
};

Powered by Google App Engine
This is Rietveld 408576698