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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 embedder.test.assertEq( | 379 embedder.test.assertEq( |
380 'function', | 380 'function', |
381 typeof webview.request[apiPropertiesToCheck[i]].addRules); | 381 typeof webview.request[apiPropertiesToCheck[i]].addRules); |
382 embedder.test.assertEq( | 382 embedder.test.assertEq( |
383 'function', | 383 'function', |
384 typeof webview.request[apiPropertiesToCheck[i]].getRules); | 384 typeof webview.request[apiPropertiesToCheck[i]].getRules); |
385 embedder.test.assertEq( | 385 embedder.test.assertEq( |
386 'function', | 386 'function', |
387 typeof webview.request[apiPropertiesToCheck[i]].removeRules); | 387 typeof webview.request[apiPropertiesToCheck[i]].removeRules); |
388 } | 388 } |
| 389 |
| 390 // Try to overwrite webview.request, shall not succeed. |
| 391 webview.request = '123'; |
| 392 embedder.test.assertTrue(typeof webview.request !== 'string'); |
| 393 |
389 embedder.test.succeed(); | 394 embedder.test.succeed(); |
390 }); | 395 }); |
391 webview.setAttribute('src', 'data:text/html,webview check api'); | 396 webview.setAttribute('src', 'data:text/html,webview check api'); |
392 document.body.appendChild(webview); | 397 document.body.appendChild(webview); |
393 } | 398 } |
394 | 399 |
395 // This test verifies that the loadstart, loadstop, and exit events fire as | 400 // This test verifies that the loadstart, loadstop, and exit events fire as |
396 // expected. | 401 // expected. |
397 function testEventName() { | 402 function testEventName() { |
398 var webview = document.createElement('webview'); | 403 var webview = document.createElement('webview'); |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 'testFindAPI': testFindAPI, | 1518 'testFindAPI': testFindAPI, |
1514 'testFindAPI_findupdate': testFindAPI | 1519 'testFindAPI_findupdate': testFindAPI |
1515 }; | 1520 }; |
1516 | 1521 |
1517 onload = function() { | 1522 onload = function() { |
1518 chrome.test.getConfig(function(config) { | 1523 chrome.test.getConfig(function(config) { |
1519 embedder.setUp_(config); | 1524 embedder.setUp_(config); |
1520 chrome.test.sendMessage("Launched"); | 1525 chrome.test.sendMessage("Launched"); |
1521 }); | 1526 }); |
1522 }; | 1527 }; |
OLD | NEW |