| 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 da33baca2e1bf14f59da153d7aeeb430a6a6def0..fdc08a68871fa997184ba67d2074aaa8828a1de7 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
|
| @@ -984,7 +984,7 @@ function testDeclarativeWebRequestAPI() {
|
| webview.request.onRequest.removeRules();
|
| webview.reload();
|
| });
|
| - webview.addEventListener('loadcommit', function(e) {
|
| + webview.addEventListener('loadstop', function(e) {
|
| embedder.test.assertEq(2, step);
|
| embedder.test.succeed();
|
| });
|
| @@ -992,6 +992,30 @@ function testDeclarativeWebRequestAPI() {
|
| document.body.appendChild(webview);
|
| }
|
|
|
| +function testDeclarativeWebRequestAPISendMessage() {
|
| + var webview = new WebView();
|
| + window.console.log(embedder.emptyGuestURL);
|
| + var rule = {
|
| + conditions: [
|
| + new chrome.webViewRequest.RequestMatcher(
|
| + {
|
| + url: { urlContains: 'guest' }
|
| + }
|
| + )
|
| + ],
|
| + actions: [
|
| + new chrome.webViewRequest.SendMessageToExtension({ message: 'bleep' })
|
| + ]
|
| + };
|
| + webview.request.onRequest.addRules([rule]);
|
| + webview.request.onMessage.addListener(function(e) {
|
| + embedder.test.assertEq('bleep', e.message);
|
| + embedder.test.succeed();
|
| + });
|
| + webview.src = embedder.emptyGuestURL;
|
| + document.body.appendChild(webview);
|
| +}
|
| +
|
| // This test verifies that the WebRequest API onBeforeRequest event fires on
|
| // clients*.google.com URLs.
|
| function testWebRequestAPIGoogleProperty() {
|
| @@ -1679,6 +1703,8 @@ embedder.test.testList = {
|
| 'testNewWindowNoReferrerLink': testNewWindowNoReferrerLink,
|
| 'testContentLoadEvent': testContentLoadEvent,
|
| 'testDeclarativeWebRequestAPI': testDeclarativeWebRequestAPI,
|
| + 'testDeclarativeWebRequestAPISendMessage':
|
| + testDeclarativeWebRequestAPISendMessage,
|
| 'testWebRequestAPI': testWebRequestAPI,
|
| 'testWebRequestAPIGoogleProperty': testWebRequestAPIGoogleProperty,
|
| 'testWebRequestListenerSurvivesReparenting':
|
|
|