OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 util = {}; | 5 var util = {}; |
6 var embedder = {}; | 6 var embedder = {}; |
7 embedder.baseGuestURL = ''; | 7 embedder.baseGuestURL = ''; |
8 embedder.emptyGuestURL = ''; | 8 embedder.emptyGuestURL = ''; |
9 embedder.windowOpenGuestURL = ''; | 9 embedder.windowOpenGuestURL = ''; |
10 embedder.noReferrerGuestURL = ''; | 10 embedder.noReferrerGuestURL = ''; |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 webview.addEventListener('loadabort', function(e) { | 309 webview.addEventListener('loadabort', function(e) { |
310 embedder.test.fail(); | 310 embedder.test.fail(); |
311 }); | 311 }); |
312 webview.addEventListener('loadstop', function(e) { | 312 webview.addEventListener('loadstop', function(e) { |
313 embedder.test.succeed(); | 313 embedder.test.succeed(); |
314 }); | 314 }); |
315 webview.setAttribute('src', localResource); | 315 webview.setAttribute('src', localResource); |
316 document.body.appendChild(webview); | 316 document.body.appendChild(webview); |
317 } | 317 } |
318 | 318 |
319 // This test verifies that the loadstop event fires when loading a webview | |
320 // accessible resource from a partition that is privileged if the src URL | |
321 // is not fully qualified. | |
322 function testChromeExtensionRelativePath() { | |
323 var webview = document.createElement('webview'); | |
324 // foobar is a privileged partition according to the manifest file. | |
Charlie Reis
2013/10/18 17:37:55
Hmm, I'm still uncomfortable with these being call
Fady Samuel
2013/10/25 21:10:31
Agreed. I'm supportive of changing the name.
| |
325 webview.partition = 'foobar'; | |
326 webview.addEventListener('loadabort', function(e) { | |
327 embedder.test.fail(); | |
328 }); | |
329 webview.addEventListener('loadstop', function(e) { | |
330 embedder.test.succeed(); | |
331 }); | |
332 webview.setAttribute('src', 'guest.html'); | |
333 document.body.appendChild(webview); | |
334 } | |
335 | |
319 function testWebRequestAPIExistence() { | 336 function testWebRequestAPIExistence() { |
320 var apiPropertiesToCheck = [ | 337 var apiPropertiesToCheck = [ |
321 'onBeforeRequest', | 338 'onBeforeRequest', |
322 'onBeforeSendHeaders', | 339 'onBeforeSendHeaders', |
323 'onSendHeaders', | 340 'onSendHeaders', |
324 'onHeadersReceived', | 341 'onHeadersReceived', |
325 'onAuthRequired', | 342 'onAuthRequired', |
326 'onBeforeRedirect', | 343 'onBeforeRedirect', |
327 'onResponseStarted', | 344 'onResponseStarted', |
328 'onCompleted', | 345 'onCompleted', |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1107 document.body.appendChild(webview); | 1124 document.body.appendChild(webview); |
1108 } | 1125 } |
1109 | 1126 |
1110 embedder.test.testList = { | 1127 embedder.test.testList = { |
1111 'testAutosizeAfterNavigation': testAutosizeAfterNavigation, | 1128 'testAutosizeAfterNavigation': testAutosizeAfterNavigation, |
1112 'testAutosizeBeforeNavigation': testAutosizeBeforeNavigation, | 1129 'testAutosizeBeforeNavigation': testAutosizeBeforeNavigation, |
1113 'testAutosizeRemoveAttributes': testAutosizeRemoveAttributes, | 1130 'testAutosizeRemoveAttributes': testAutosizeRemoveAttributes, |
1114 'testAutosizeWithPartialAttributes': testAutosizeWithPartialAttributes, | 1131 'testAutosizeWithPartialAttributes': testAutosizeWithPartialAttributes, |
1115 'testAPIMethodExistence': testAPIMethodExistence, | 1132 'testAPIMethodExistence': testAPIMethodExistence, |
1116 'testChromeExtensionURL': testChromeExtensionURL, | 1133 'testChromeExtensionURL': testChromeExtensionURL, |
1134 'testChromeExtensionRelativePath': testChromeExtensionRelativePath, | |
1117 'testWebRequestAPIExistence': testWebRequestAPIExistence, | 1135 'testWebRequestAPIExistence': testWebRequestAPIExistence, |
1118 'testEventName': testEventName, | 1136 'testEventName': testEventName, |
1119 'testOnEventProperties': testOnEventProperties, | 1137 'testOnEventProperties': testOnEventProperties, |
1120 'testLoadProgressEvent': testLoadProgressEvent, | 1138 'testLoadProgressEvent': testLoadProgressEvent, |
1121 'testDestroyOnEventListener': testDestroyOnEventListener, | 1139 'testDestroyOnEventListener': testDestroyOnEventListener, |
1122 'testCannotMutateEventName': testCannotMutateEventName, | 1140 'testCannotMutateEventName': testCannotMutateEventName, |
1123 'testPartitionRaisesException': testPartitionRaisesException, | 1141 'testPartitionRaisesException': testPartitionRaisesException, |
1124 'testExecuteScriptFail': testExecuteScriptFail, | 1142 'testExecuteScriptFail': testExecuteScriptFail, |
1125 'testExecuteScript': testExecuteScript, | 1143 'testExecuteScript': testExecuteScript, |
1126 'testTerminateAfterExit': testTerminateAfterExit, | 1144 'testTerminateAfterExit': testTerminateAfterExit, |
(...skipping 28 matching lines...) Expand all Loading... | |
1155 'testRemoveWebviewAfterNavigation': testRemoveWebviewAfterNavigation, | 1173 'testRemoveWebviewAfterNavigation': testRemoveWebviewAfterNavigation, |
1156 'testResizeWebviewResizesContent': testResizeWebviewResizesContent | 1174 'testResizeWebviewResizesContent': testResizeWebviewResizesContent |
1157 }; | 1175 }; |
1158 | 1176 |
1159 onload = function() { | 1177 onload = function() { |
1160 chrome.test.getConfig(function(config) { | 1178 chrome.test.getConfig(function(config) { |
1161 embedder.setUp_(config); | 1179 embedder.setUp_(config); |
1162 chrome.test.sendMessage("Launched"); | 1180 chrome.test.sendMessage("Launched"); |
1163 }); | 1181 }); |
1164 }; | 1182 }; |
OLD | NEW |