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 2704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2715 webview.focus(); | 2715 webview.focus(); |
2716 webview.focus(); | 2716 webview.focus(); |
2717 embedder.test.assertTrue(document.activeElement = webview); | 2717 embedder.test.assertTrue(document.activeElement = webview); |
2718 embedder.test.assertTrue(webview.shadowRoot.activeElement); | 2718 embedder.test.assertTrue(webview.shadowRoot.activeElement); |
2719 embedder.test.succeed(); | 2719 embedder.test.succeed(); |
2720 }); | 2720 }); |
2721 | 2721 |
2722 document.body.appendChild(webview); | 2722 document.body.appendChild(webview); |
2723 } | 2723 } |
2724 | 2724 |
| 2725 function testPDFInWebview() { |
| 2726 var webview = document.createElement('webview'); |
| 2727 var pdfUrl = 'test.pdf'; |
| 2728 // partition 'foobar' has access to local resource |pdfUrl|. |
| 2729 webview.partition = 'foobar'; |
| 2730 webview.onloadstop = embedder.test.succeed; |
| 2731 webview.onloadabort = embedder.test.fail; |
| 2732 webview.setAttribute('src', pdfUrl); |
| 2733 document.body.appendChild(webview); |
| 2734 } |
| 2735 |
2725 embedder.test.testList = { | 2736 embedder.test.testList = { |
2726 'testAllowTransparencyAttribute': testAllowTransparencyAttribute, | 2737 'testAllowTransparencyAttribute': testAllowTransparencyAttribute, |
2727 'testAutosizeHeight': testAutosizeHeight, | 2738 'testAutosizeHeight': testAutosizeHeight, |
2728 'testAutosizeAfterNavigation': testAutosizeAfterNavigation, | 2739 'testAutosizeAfterNavigation': testAutosizeAfterNavigation, |
2729 'testAutosizeBeforeNavigation': testAutosizeBeforeNavigation, | 2740 'testAutosizeBeforeNavigation': testAutosizeBeforeNavigation, |
2730 'testAutosizeRemoveAttributes': testAutosizeRemoveAttributes, | 2741 'testAutosizeRemoveAttributes': testAutosizeRemoveAttributes, |
2731 'testAutosizeWithPartialAttributes': testAutosizeWithPartialAttributes, | 2742 'testAutosizeWithPartialAttributes': testAutosizeWithPartialAttributes, |
2732 'testAPIMethodExistence': testAPIMethodExistence, | 2743 'testAPIMethodExistence': testAPIMethodExistence, |
2733 'testChromeExtensionURL': testChromeExtensionURL, | 2744 'testChromeExtensionURL': testChromeExtensionURL, |
2734 'testChromeExtensionRelativePath': testChromeExtensionRelativePath, | 2745 'testChromeExtensionRelativePath': testChromeExtensionRelativePath, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2815 'testFindAPI_findupdate': testFindAPI, | 2826 'testFindAPI_findupdate': testFindAPI, |
2816 'testLoadDataAPI': testLoadDataAPI, | 2827 'testLoadDataAPI': testLoadDataAPI, |
2817 'testResizeEvents': testResizeEvents, | 2828 'testResizeEvents': testResizeEvents, |
2818 'testPerOriginZoomMode': testPerOriginZoomMode, | 2829 'testPerOriginZoomMode': testPerOriginZoomMode, |
2819 'testPerViewZoomMode': testPerViewZoomMode, | 2830 'testPerViewZoomMode': testPerViewZoomMode, |
2820 'testDisabledZoomMode': testDisabledZoomMode, | 2831 'testDisabledZoomMode': testDisabledZoomMode, |
2821 'testZoomBeforeNavigation': testZoomBeforeNavigation, | 2832 'testZoomBeforeNavigation': testZoomBeforeNavigation, |
2822 'testPlugin': testPlugin, | 2833 'testPlugin': testPlugin, |
2823 'testGarbageCollect': testGarbageCollect, | 2834 'testGarbageCollect': testGarbageCollect, |
2824 'testCloseNewWindowCleanup': testCloseNewWindowCleanup, | 2835 'testCloseNewWindowCleanup': testCloseNewWindowCleanup, |
2825 'testFocusWhileFocused': testFocusWhileFocused | 2836 'testFocusWhileFocused': testFocusWhileFocused, |
| 2837 'testPDFInWebview': testPDFInWebview |
2826 }; | 2838 }; |
2827 | 2839 |
2828 onload = function() { | 2840 onload = function() { |
2829 chrome.test.getConfig(function(config) { | 2841 chrome.test.getConfig(function(config) { |
2830 embedder.setUp_(config); | 2842 embedder.setUp_(config); |
2831 chrome.test.sendMessage("Launched"); | 2843 chrome.test.sendMessage("Launched"); |
2832 }); | 2844 }); |
2833 }; | 2845 }; |
OLD | NEW |