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

Side by Side Diff: extensions/test/data/web_view/apitest/main.js

Issue 2042483002: Fix web_accesible_resources enforcement for Site Isolation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes for code review, removed filter exceptions. Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 embedder = {}; 5 var embedder = {};
6 6
7 // TODO(lfg) Move these functions to a common js. 7 // TODO(lfg) Move these functions to a common js.
8 embedder.setUp_ = function(config) { 8 embedder.setUp_ = function(config) {
9 if (!config || !config.testServer) { 9 if (!config || !config.testServer) {
10 return; 10 return;
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 webview.setAttribute('src', invalidResource); 940 webview.setAttribute('src', invalidResource);
941 document.body.appendChild(webview); 941 document.body.appendChild(webview);
942 } 942 }
943 943
944 // This test verifies that the loadabort event fires when loading a webview 944 // This test verifies that the loadabort event fires when loading a webview
945 // accessible resource from a partition that is not privileged. 945 // accessible resource from a partition that is not privileged.
946 function testLoadAbortChromeExtensionURLWrongPartition() { 946 function testLoadAbortChromeExtensionURLWrongPartition() {
947 var localResource = chrome.runtime.getURL('guest.html'); 947 var localResource = chrome.runtime.getURL('guest.html');
948 var webview = document.createElement('webview'); 948 var webview = document.createElement('webview');
949 webview.addEventListener('loadabort', function(e) { 949 webview.addEventListener('loadabort', function(e) {
950 embedder.test.assertEq('ERR_ADDRESS_UNREACHABLE', e.reason); 950 embedder.test.assertEq('ERR_BLOCKED_BY_CLIENT', e.reason);
951 embedder.test.succeed(); 951 embedder.test.succeed();
952 }); 952 });
953 webview.addEventListener('loadstop', function(e) { 953 webview.addEventListener('loadstop', function(e) {
954 embedder.test.fail(); 954 embedder.test.fail();
955 }); 955 });
956 webview.setAttribute('src', localResource); 956 webview.setAttribute('src', localResource);
957 document.body.appendChild(webview); 957 document.body.appendChild(webview);
958 } 958 }
959 959
960 // This test verifies that the loadabort event fires as expected and with the 960 // This test verifies that the loadabort event fires as expected and with the
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1785 'testWebRequestAPIGoogleProperty': testWebRequestAPIGoogleProperty, 1785 'testWebRequestAPIGoogleProperty': testWebRequestAPIGoogleProperty,
1786 'testCaptureVisibleRegion': testCaptureVisibleRegion 1786 'testCaptureVisibleRegion': testCaptureVisibleRegion
1787 }; 1787 };
1788 1788
1789 onload = function() { 1789 onload = function() {
1790 chrome.test.getConfig(function(config) { 1790 chrome.test.getConfig(function(config) {
1791 embedder.setUp_(config); 1791 embedder.setUp_(config);
1792 chrome.test.sendMessage('LAUNCHED'); 1792 chrome.test.sendMessage('LAUNCHED');
1793 }); 1793 });
1794 }; 1794 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698