| 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 // on the <webview> tag. | 572 // on the <webview> tag. |
| 573 webview.addEventListener('loadcommit', onLoadCommitA); | 573 webview.addEventListener('loadcommit', onLoadCommitA); |
| 574 webview.addEventListener('loadcommit', onLoadCommitB); | 574 webview.addEventListener('loadcommit', onLoadCommitB); |
| 575 webview.setAttribute('src', url); | 575 webview.setAttribute('src', url); |
| 576 } | 576 } |
| 577 | 577 |
| 578 // This test verifies that setting the partition attribute after the src has | 578 // This test verifies that setting the partition attribute after the src has |
| 579 // been set raises an exception. | 579 // been set raises an exception. |
| 580 function testPartitionRaisesException() { | 580 function testPartitionRaisesException() { |
| 581 var webview = document.createElement('webview'); | 581 var webview = document.createElement('webview'); |
| 582 webview.setAttribute('partition', arguments.callee.name); | 582 var partitionAttribute = arguments.callee.name; |
| 583 webview.setAttribute('partition', partitionAttribute); |
| 583 webview.setAttribute('src', 'data:text/html,trigger navigation'); | 584 webview.setAttribute('src', 'data:text/html,trigger navigation'); |
| 584 document.body.appendChild(webview); | 585 document.body.appendChild(webview); |
| 585 setTimeout(function() { | 586 setTimeout(function() { |
| 586 try { | 587 try { |
| 587 webview.partition = 'illegal'; | 588 webview.partition = 'illegal'; |
| 588 embedder.test.fail(); | 589 embedder.test.fail(); |
| 589 } catch (e) { | 590 } catch (e) { |
| 591 embedder.test.assertEq(partitionAttribute, webview.partition); |
| 590 embedder.test.succeed(); | 592 embedder.test.succeed(); |
| 591 } | 593 } |
| 592 }, 0); | 594 }, 0); |
| 593 } | 595 } |
| 594 | 596 |
| 595 function testExecuteScriptFail() { | 597 function testExecuteScriptFail() { |
| 596 var webview = document.createElement('webview'); | 598 var webview = document.createElement('webview'); |
| 597 document.body.appendChild(webview); | 599 document.body.appendChild(webview); |
| 598 setTimeout(function() { | 600 setTimeout(function() { |
| 599 try { | 601 try { |
| (...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 'testFindAPI': testFindAPI, | 1708 'testFindAPI': testFindAPI, |
| 1707 'testFindAPI_findupdate': testFindAPI | 1709 'testFindAPI_findupdate': testFindAPI |
| 1708 }; | 1710 }; |
| 1709 | 1711 |
| 1710 onload = function() { | 1712 onload = function() { |
| 1711 chrome.test.getConfig(function(config) { | 1713 chrome.test.getConfig(function(config) { |
| 1712 embedder.setUp_(config); | 1714 embedder.setUp_(config); |
| 1713 chrome.test.sendMessage("Launched"); | 1715 chrome.test.sendMessage("Launched"); |
| 1714 }); | 1716 }); |
| 1715 }; | 1717 }; |
| OLD | NEW |