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 2688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2699 // Close the second app window, which should not trigger the whole | 2699 // Close the second app window, which should not trigger the whole |
2700 // embedder process to be cleaned up. | 2700 // embedder process to be cleaned up. |
2701 appWindow.contentWindow.close(); | 2701 appWindow.contentWindow.close(); |
2702 embedder.test.succeed(); | 2702 embedder.test.succeed(); |
2703 }); | 2703 }); |
2704 webview.src = 'about:blank'; | 2704 webview.src = 'about:blank'; |
2705 }; | 2705 }; |
2706 }); | 2706 }); |
2707 } | 2707 } |
2708 | 2708 |
| 2709 function testFocusWhileFocused() { |
| 2710 var webview = new WebView(); |
| 2711 webview.src = 'about:blank'; |
| 2712 |
| 2713 webview.addEventListener('loadstop', function(e) { |
| 2714 // Focus twice, then make sure that the internal element is still focused. |
| 2715 webview.focus(); |
| 2716 webview.focus(); |
| 2717 embedder.test.assertTrue(document.activeElement = webview); |
| 2718 embedder.test.assertTrue(webview.shadowRoot.activeElement); |
| 2719 embedder.test.succeed(); |
| 2720 }); |
| 2721 |
| 2722 document.body.appendChild(webview); |
| 2723 } |
| 2724 |
2709 embedder.test.testList = { | 2725 embedder.test.testList = { |
2710 'testAllowTransparencyAttribute': testAllowTransparencyAttribute, | 2726 'testAllowTransparencyAttribute': testAllowTransparencyAttribute, |
2711 'testAutosizeHeight': testAutosizeHeight, | 2727 'testAutosizeHeight': testAutosizeHeight, |
2712 'testAutosizeAfterNavigation': testAutosizeAfterNavigation, | 2728 'testAutosizeAfterNavigation': testAutosizeAfterNavigation, |
2713 'testAutosizeBeforeNavigation': testAutosizeBeforeNavigation, | 2729 'testAutosizeBeforeNavigation': testAutosizeBeforeNavigation, |
2714 'testAutosizeRemoveAttributes': testAutosizeRemoveAttributes, | 2730 'testAutosizeRemoveAttributes': testAutosizeRemoveAttributes, |
2715 'testAutosizeWithPartialAttributes': testAutosizeWithPartialAttributes, | 2731 'testAutosizeWithPartialAttributes': testAutosizeWithPartialAttributes, |
2716 'testAPIMethodExistence': testAPIMethodExistence, | 2732 'testAPIMethodExistence': testAPIMethodExistence, |
2717 'testChromeExtensionURL': testChromeExtensionURL, | 2733 'testChromeExtensionURL': testChromeExtensionURL, |
2718 'testChromeExtensionRelativePath': testChromeExtensionRelativePath, | 2734 'testChromeExtensionRelativePath': testChromeExtensionRelativePath, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2798 'testFindAPI': testFindAPI, | 2814 'testFindAPI': testFindAPI, |
2799 'testFindAPI_findupdate': testFindAPI, | 2815 'testFindAPI_findupdate': testFindAPI, |
2800 'testLoadDataAPI': testLoadDataAPI, | 2816 'testLoadDataAPI': testLoadDataAPI, |
2801 'testResizeEvents': testResizeEvents, | 2817 'testResizeEvents': testResizeEvents, |
2802 'testPerOriginZoomMode': testPerOriginZoomMode, | 2818 'testPerOriginZoomMode': testPerOriginZoomMode, |
2803 'testPerViewZoomMode': testPerViewZoomMode, | 2819 'testPerViewZoomMode': testPerViewZoomMode, |
2804 'testDisabledZoomMode': testDisabledZoomMode, | 2820 'testDisabledZoomMode': testDisabledZoomMode, |
2805 'testZoomBeforeNavigation': testZoomBeforeNavigation, | 2821 'testZoomBeforeNavigation': testZoomBeforeNavigation, |
2806 'testPlugin': testPlugin, | 2822 'testPlugin': testPlugin, |
2807 'testGarbageCollect': testGarbageCollect, | 2823 'testGarbageCollect': testGarbageCollect, |
2808 'testCloseNewWindowCleanup': testCloseNewWindowCleanup | 2824 'testCloseNewWindowCleanup': testCloseNewWindowCleanup, |
| 2825 'testFocusWhileFocused': testFocusWhileFocused |
2809 }; | 2826 }; |
2810 | 2827 |
2811 onload = function() { | 2828 onload = function() { |
2812 chrome.test.getConfig(function(config) { | 2829 chrome.test.getConfig(function(config) { |
2813 embedder.setUp_(config); | 2830 embedder.setUp_(config); |
2814 chrome.test.sendMessage("Launched"); | 2831 chrome.test.sendMessage("Launched"); |
2815 }); | 2832 }); |
2816 }; | 2833 }; |
OLD | NEW |