| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <queue> | 5 #include <queue> |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 | 705 |
| 706 scoped_ptr<content::FakeSpeechRecognitionManager> | 706 scoped_ptr<content::FakeSpeechRecognitionManager> |
| 707 fake_speech_recognition_manager_; | 707 fake_speech_recognition_manager_; |
| 708 | 708 |
| 709 TestGuestViewManagerFactory factory_; | 709 TestGuestViewManagerFactory factory_; |
| 710 // Note that these are only set if you launch app using LoadAppWithGuest(). | 710 // Note that these are only set if you launch app using LoadAppWithGuest(). |
| 711 content::WebContents* guest_web_contents_; | 711 content::WebContents* guest_web_contents_; |
| 712 content::WebContents* embedder_web_contents_; | 712 content::WebContents* embedder_web_contents_; |
| 713 }; | 713 }; |
| 714 | 714 |
| 715 // The following test suits are created to group tests based on specific |
| 716 // features of <webview>. |
| 717 // These features current would not work with --site-per-process and is |
| 718 // disabled on site isolation FYI bots. |
| 719 class WebViewNewWindowTest : public WebViewTest {}; |
| 720 class WebViewSizeTest : public WebViewTest {}; |
| 721 class WebViewSpeechAPITest : public WebViewTest {}; |
| 722 class WebViewVisibilityTest : public WebViewTest {}; |
| 723 |
| 715 // Test suite that containts tests that are meant to run with and without | 724 // Test suite that containts tests that are meant to run with and without |
| 716 // --site-per-process. | 725 // --site-per-process. |
| 717 class WebViewCommonTest : public extensions::PlatformAppBrowserTest {}; | 726 class WebViewCommonTest : public extensions::PlatformAppBrowserTest {}; |
| 718 | 727 |
| 719 class WebViewDPITest : public WebViewTest { | 728 class WebViewDPITest : public WebViewTest { |
| 720 protected: | 729 protected: |
| 721 void SetUpCommandLine(base::CommandLine* command_line) override { | 730 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 722 WebViewTest::SetUpCommandLine(command_line); | 731 WebViewTest::SetUpCommandLine(command_line); |
| 723 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, | 732 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, |
| 724 base::StringPrintf("%f", scale())); | 733 base::StringPrintf("%f", scale())); |
| 725 } | 734 } |
| 726 | 735 |
| 727 static float scale() { return 2.0f; } | 736 static float scale() { return 2.0f; } |
| 728 }; | 737 }; |
| 729 | 738 |
| 730 // This test verifies that hiding the guest triggers WebContents::WasHidden(). | 739 // This test verifies that hiding the guest triggers WebContents::WasHidden(). |
| 731 IN_PROC_BROWSER_TEST_F(WebViewTest, GuestVisibilityChanged) { | 740 IN_PROC_BROWSER_TEST_F(WebViewVisibilityTest, GuestVisibilityChanged) { |
| 732 LoadAppWithGuest("web_view/visibility_changed"); | 741 LoadAppWithGuest("web_view/visibility_changed"); |
| 733 | 742 |
| 734 scoped_refptr<content::MessageLoopRunner> loop_runner( | 743 scoped_refptr<content::MessageLoopRunner> loop_runner( |
| 735 new content::MessageLoopRunner); | 744 new content::MessageLoopRunner); |
| 736 WebContentsHiddenObserver observer(GetGuestWebContents(), | 745 WebContentsHiddenObserver observer(GetGuestWebContents(), |
| 737 loop_runner->QuitClosure()); | 746 loop_runner->QuitClosure()); |
| 738 | 747 |
| 739 // Handled in platform_apps/web_view/visibility_changed/main.js | 748 // Handled in platform_apps/web_view/visibility_changed/main.js |
| 740 SendMessageToEmbedder("hide-guest"); | 749 SendMessageToEmbedder("hide-guest"); |
| 741 if (!observer.hidden_observed()) | 750 if (!observer.hidden_observed()) |
| 742 loop_runner->Run(); | 751 loop_runner->Run(); |
| 743 } | 752 } |
| 744 | 753 |
| 745 // This test verifies that hiding the embedder also hides the guest. | 754 // This test verifies that hiding the embedder also hides the guest. |
| 746 IN_PROC_BROWSER_TEST_F(WebViewTest, EmbedderVisibilityChanged) { | 755 IN_PROC_BROWSER_TEST_F(WebViewVisibilityTest, EmbedderVisibilityChanged) { |
| 747 LoadAppWithGuest("web_view/visibility_changed"); | 756 LoadAppWithGuest("web_view/visibility_changed"); |
| 748 | 757 |
| 749 scoped_refptr<content::MessageLoopRunner> loop_runner( | 758 scoped_refptr<content::MessageLoopRunner> loop_runner( |
| 750 new content::MessageLoopRunner); | 759 new content::MessageLoopRunner); |
| 751 WebContentsHiddenObserver observer(GetGuestWebContents(), | 760 WebContentsHiddenObserver observer(GetGuestWebContents(), |
| 752 loop_runner->QuitClosure()); | 761 loop_runner->QuitClosure()); |
| 753 | 762 |
| 754 // Handled in platform_apps/web_view/visibility_changed/main.js | 763 // Handled in platform_apps/web_view/visibility_changed/main.js |
| 755 SendMessageToEmbedder("hide-embedder"); | 764 SendMessageToEmbedder("hide-embedder"); |
| 756 if (!observer.hidden_observed()) | 765 if (!observer.hidden_observed()) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 | 809 |
| 801 // This test ensures JavaScript errors ("Cannot redefine property") do not | 810 // This test ensures JavaScript errors ("Cannot redefine property") do not |
| 802 // happen when a <webview> is removed from DOM and added back. | 811 // happen when a <webview> is removed from DOM and added back. |
| 803 IN_PROC_BROWSER_TEST_F(WebViewTest, | 812 IN_PROC_BROWSER_TEST_F(WebViewTest, |
| 804 AddRemoveWebView_AddRemoveWebView) { | 813 AddRemoveWebView_AddRemoveWebView) { |
| 805 ASSERT_TRUE(StartEmbeddedTestServer()); // For serving guest pages. | 814 ASSERT_TRUE(StartEmbeddedTestServer()); // For serving guest pages. |
| 806 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/addremove")) | 815 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/addremove")) |
| 807 << message_; | 816 << message_; |
| 808 } | 817 } |
| 809 | 818 |
| 810 IN_PROC_BROWSER_TEST_F(WebViewTest, AutoSize) { | 819 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, AutoSize) { |
| 811 #if defined(OS_WIN) | 820 #if defined(OS_WIN) |
| 812 // Flaky on XP bot http://crbug.com/299507 | 821 // Flaky on XP bot http://crbug.com/299507 |
| 813 if (base::win::GetVersion() <= base::win::VERSION_XP) | 822 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 814 return; | 823 return; |
| 815 #endif | 824 #endif |
| 816 | 825 |
| 817 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/autosize")) | 826 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/autosize")) |
| 818 << message_; | 827 << message_; |
| 819 } | 828 } |
| 820 | 829 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 837 } | 846 } |
| 838 | 847 |
| 839 // Checks that {allFrames: true} injects script correctly to subframes | 848 // Checks that {allFrames: true} injects script correctly to subframes |
| 840 // inside <webview>. | 849 // inside <webview>. |
| 841 IN_PROC_BROWSER_TEST_F(WebViewTest, ExecuteScript) { | 850 IN_PROC_BROWSER_TEST_F(WebViewTest, ExecuteScript) { |
| 842 ASSERT_TRUE(RunPlatformAppTestWithArg( | 851 ASSERT_TRUE(RunPlatformAppTestWithArg( |
| 843 "platform_apps/web_view/common", "execute_script")) << message_; | 852 "platform_apps/web_view/common", "execute_script")) << message_; |
| 844 } | 853 } |
| 845 | 854 |
| 846 // http://crbug.com/326332 | 855 // http://crbug.com/326332 |
| 847 IN_PROC_BROWSER_TEST_F(WebViewTest, DISABLED_Shim_TestAutosizeAfterNavigation) { | 856 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, |
| 857 DISABLED_Shim_TestAutosizeAfterNavigation) { |
| 848 TestHelper("testAutosizeAfterNavigation", "web_view/shim", NO_TEST_SERVER); | 858 TestHelper("testAutosizeAfterNavigation", "web_view/shim", NO_TEST_SERVER); |
| 849 } | 859 } |
| 850 | 860 |
| 851 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAllowTransparencyAttribute) { | 861 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAllowTransparencyAttribute) { |
| 852 TestHelper("testAllowTransparencyAttribute", "web_view/shim", NO_TEST_SERVER); | 862 TestHelper("testAllowTransparencyAttribute", "web_view/shim", NO_TEST_SERVER); |
| 853 } | 863 } |
| 854 | 864 |
| 855 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeHeight) { | 865 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeHeight) { |
| 856 TestHelper("testAutosizeHeight", "web_view/shim", NO_TEST_SERVER); | 866 TestHelper("testAutosizeHeight", "web_view/shim", NO_TEST_SERVER); |
| 857 } | 867 } |
| 858 | 868 |
| 859 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAutosizeHeight) { | 869 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestAutosizeHeight) { |
| 860 TestHelper("testAutosizeHeight", "web_view/shim", NO_TEST_SERVER); | 870 TestHelper("testAutosizeHeight", "web_view/shim", NO_TEST_SERVER); |
| 861 } | 871 } |
| 862 | 872 |
| 863 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeBeforeNavigation) { | 873 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeBeforeNavigation) { |
| 864 TestHelper("testAutosizeBeforeNavigation", "web_view/shim", NO_TEST_SERVER); | 874 TestHelper("testAutosizeBeforeNavigation", "web_view/shim", NO_TEST_SERVER); |
| 865 } | 875 } |
| 866 | 876 |
| 867 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAutosizeBeforeNavigation) { | 877 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestAutosizeBeforeNavigation) { |
| 868 TestHelper("testAutosizeBeforeNavigation", "web_view/shim", NO_TEST_SERVER); | 878 TestHelper("testAutosizeBeforeNavigation", "web_view/shim", NO_TEST_SERVER); |
| 869 } | 879 } |
| 870 | 880 |
| 871 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeRemoveAttributes) { | 881 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeRemoveAttributes) { |
| 872 TestHelper("testAutosizeRemoveAttributes", "web_view/shim", NO_TEST_SERVER); | 882 TestHelper("testAutosizeRemoveAttributes", "web_view/shim", NO_TEST_SERVER); |
| 873 } | 883 } |
| 874 | 884 |
| 875 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAutosizeRemoveAttributes) { | 885 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestAutosizeRemoveAttributes) { |
| 876 TestHelper("testAutosizeRemoveAttributes", "web_view/shim", NO_TEST_SERVER); | 886 TestHelper("testAutosizeRemoveAttributes", "web_view/shim", NO_TEST_SERVER); |
| 877 } | 887 } |
| 878 | 888 |
| 879 // This test is disabled due to being flaky. http://crbug.com/282116 | 889 // This test is disabled due to being flaky. http://crbug.com/282116 |
| 880 IN_PROC_BROWSER_TEST_F(WebViewTest, | 890 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, |
| 881 DISABLED_Shim_TestAutosizeWithPartialAttributes) { | 891 DISABLED_Shim_TestAutosizeWithPartialAttributes) { |
| 882 TestHelper("testAutosizeWithPartialAttributes", | 892 TestHelper("testAutosizeWithPartialAttributes", |
| 883 "web_view/shim", | 893 "web_view/shim", |
| 884 NO_TEST_SERVER); | 894 NO_TEST_SERVER); |
| 885 } | 895 } |
| 886 | 896 |
| 887 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAPIMethodExistence) { | 897 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAPIMethodExistence) { |
| 888 TestHelper("testAPIMethodExistence", "web_view/shim", NO_TEST_SERVER); | 898 TestHelper("testAPIMethodExistence", "web_view/shim", NO_TEST_SERVER); |
| 889 } | 899 } |
| 890 | 900 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 Shim_TestAddContentScriptToOneWebViewShouldNotInjectToTheOtherWebView) { | 1007 Shim_TestAddContentScriptToOneWebViewShouldNotInjectToTheOtherWebView) { |
| 998 TestHelper("testAddContentScriptToOneWebViewShouldNotInjectToTheOtherWebView", | 1008 TestHelper("testAddContentScriptToOneWebViewShouldNotInjectToTheOtherWebView", |
| 999 "web_view/shim", NEEDS_TEST_SERVER); | 1009 "web_view/shim", NEEDS_TEST_SERVER); |
| 1000 } | 1010 } |
| 1001 | 1011 |
| 1002 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAddAndRemoveContentScripts) { | 1012 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAddAndRemoveContentScripts) { |
| 1003 TestHelper("testAddAndRemoveContentScripts", "web_view/shim", | 1013 TestHelper("testAddAndRemoveContentScripts", "web_view/shim", |
| 1004 NEEDS_TEST_SERVER); | 1014 NEEDS_TEST_SERVER); |
| 1005 } | 1015 } |
| 1006 | 1016 |
| 1007 IN_PROC_BROWSER_TEST_F(WebViewTest, | 1017 IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest, |
| 1008 Shim_TestAddContentScriptsWithNewWindowAPI) { | 1018 Shim_TestAddContentScriptsWithNewWindowAPI) { |
| 1009 TestHelper("testAddContentScriptsWithNewWindowAPI", "web_view/shim", | 1019 TestHelper("testAddContentScriptsWithNewWindowAPI", "web_view/shim", |
| 1010 NEEDS_TEST_SERVER); | 1020 NEEDS_TEST_SERVER); |
| 1011 } | 1021 } |
| 1012 | 1022 |
| 1013 IN_PROC_BROWSER_TEST_F( | 1023 IN_PROC_BROWSER_TEST_F( |
| 1014 WebViewTest, | 1024 WebViewTest, |
| 1015 Shim_TestContentScriptIsInjectedAfterTerminateAndReloadWebView) { | 1025 Shim_TestContentScriptIsInjectedAfterTerminateAndReloadWebView) { |
| 1016 TestHelper("testContentScriptIsInjectedAfterTerminateAndReloadWebView", | 1026 TestHelper("testContentScriptIsInjectedAfterTerminateAndReloadWebView", |
| 1017 "web_view/shim", NEEDS_TEST_SERVER); | 1027 "web_view/shim", NEEDS_TEST_SERVER); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 } | 1084 } |
| 1075 | 1085 |
| 1076 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestRemoveSrcAttribute) { | 1086 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestRemoveSrcAttribute) { |
| 1077 TestHelper("testRemoveSrcAttribute", "web_view/shim", NO_TEST_SERVER); | 1087 TestHelper("testRemoveSrcAttribute", "web_view/shim", NO_TEST_SERVER); |
| 1078 } | 1088 } |
| 1079 | 1089 |
| 1080 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestReassignSrcAttribute) { | 1090 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestReassignSrcAttribute) { |
| 1081 TestHelper("testReassignSrcAttribute", "web_view/shim", NO_TEST_SERVER); | 1091 TestHelper("testReassignSrcAttribute", "web_view/shim", NO_TEST_SERVER); |
| 1082 } | 1092 } |
| 1083 | 1093 |
| 1084 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestNewWindow) { | 1094 IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest, Shim_TestNewWindow) { |
| 1085 TestHelper("testNewWindow", "web_view/shim", NEEDS_TEST_SERVER); | 1095 TestHelper("testNewWindow", "web_view/shim", NEEDS_TEST_SERVER); |
| 1086 } | 1096 } |
| 1087 | 1097 |
| 1088 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestNewWindowTwoListeners) { | 1098 IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest, Shim_TestNewWindowTwoListeners) { |
| 1089 TestHelper("testNewWindowTwoListeners", "web_view/shim", NEEDS_TEST_SERVER); | 1099 TestHelper("testNewWindowTwoListeners", "web_view/shim", NEEDS_TEST_SERVER); |
| 1090 } | 1100 } |
| 1091 | 1101 |
| 1092 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestNewWindowNoPreventDefault) { | 1102 IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest, |
| 1103 Shim_TestNewWindowNoPreventDefault) { |
| 1093 TestHelper("testNewWindowNoPreventDefault", | 1104 TestHelper("testNewWindowNoPreventDefault", |
| 1094 "web_view/shim", | 1105 "web_view/shim", |
| 1095 NEEDS_TEST_SERVER); | 1106 NEEDS_TEST_SERVER); |
| 1096 } | 1107 } |
| 1097 | 1108 |
| 1098 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestNewWindowNoReferrerLink) { | 1109 IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest, Shim_TestNewWindowNoReferrerLink) { |
| 1099 TestHelper("testNewWindowNoReferrerLink", "web_view/shim", NEEDS_TEST_SERVER); | 1110 TestHelper("testNewWindowNoReferrerLink", "web_view/shim", NEEDS_TEST_SERVER); |
| 1100 } | 1111 } |
| 1101 | 1112 |
| 1102 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestContentLoadEvent) { | 1113 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestContentLoadEvent) { |
| 1103 TestHelper("testContentLoadEvent", "web_view/shim", NO_TEST_SERVER); | 1114 TestHelper("testContentLoadEvent", "web_view/shim", NO_TEST_SERVER); |
| 1104 } | 1115 } |
| 1105 | 1116 |
| 1106 // TODO(fsamuel): Enable this test once <webview> can run in a detached state. | 1117 // TODO(fsamuel): Enable this test once <webview> can run in a detached state. |
| 1107 IN_PROC_BROWSER_TEST_F(WebViewTest, | 1118 IN_PROC_BROWSER_TEST_F(WebViewTest, |
| 1108 Shim_TestContentLoadEventWithDisplayNone) { | 1119 Shim_TestContentLoadEventWithDisplayNone) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 } | 1208 } |
| 1198 | 1209 |
| 1199 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestReloadAfterTerminate) { | 1210 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestReloadAfterTerminate) { |
| 1200 TestHelper("testReloadAfterTerminate", "web_view/shim", NO_TEST_SERVER); | 1211 TestHelper("testReloadAfterTerminate", "web_view/shim", NO_TEST_SERVER); |
| 1201 } | 1212 } |
| 1202 | 1213 |
| 1203 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestGetProcessId) { | 1214 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestGetProcessId) { |
| 1204 TestHelper("testGetProcessId", "web_view/shim", NO_TEST_SERVER); | 1215 TestHelper("testGetProcessId", "web_view/shim", NO_TEST_SERVER); |
| 1205 } | 1216 } |
| 1206 | 1217 |
| 1207 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestHiddenBeforeNavigation) { | 1218 IN_PROC_BROWSER_TEST_F(WebViewVisibilityTest, Shim_TestHiddenBeforeNavigation) { |
| 1208 TestHelper("testHiddenBeforeNavigation", "web_view/shim", NO_TEST_SERVER); | 1219 TestHelper("testHiddenBeforeNavigation", "web_view/shim", NO_TEST_SERVER); |
| 1209 } | 1220 } |
| 1210 | 1221 |
| 1211 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestRemoveWebviewOnExit) { | 1222 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestRemoveWebviewOnExit) { |
| 1212 ASSERT_TRUE(StartEmbeddedTestServer()); // For serving guest pages. | 1223 ASSERT_TRUE(StartEmbeddedTestServer()); // For serving guest pages. |
| 1213 | 1224 |
| 1214 // Launch the app and wait until it's ready to load a test. | 1225 // Launch the app and wait until it's ready to load a test. |
| 1215 LoadAndLaunchPlatformApp("web_view/shim", "Launched"); | 1226 LoadAndLaunchPlatformApp("web_view/shim", "Launched"); |
| 1216 | 1227 |
| 1217 content::WebContents* embedder_web_contents = GetFirstAppWindowWebContents(); | 1228 content::WebContents* embedder_web_contents = GetFirstAppWindowWebContents(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 "web_view/shim", | 1273 "web_view/shim", |
| 1263 NO_TEST_SERVER); | 1274 NO_TEST_SERVER); |
| 1264 } | 1275 } |
| 1265 | 1276 |
| 1266 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestNavigationToExternalProtocol) { | 1277 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestNavigationToExternalProtocol) { |
| 1267 TestHelper("testNavigationToExternalProtocol", | 1278 TestHelper("testNavigationToExternalProtocol", |
| 1268 "web_view/shim", | 1279 "web_view/shim", |
| 1269 NO_TEST_SERVER); | 1280 NO_TEST_SERVER); |
| 1270 } | 1281 } |
| 1271 | 1282 |
| 1272 IN_PROC_BROWSER_TEST_F(WebViewTest, | 1283 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, |
| 1273 Shim_TestResizeWebviewWithDisplayNoneResizesContent) { | 1284 Shim_TestResizeWebviewWithDisplayNoneResizesContent) { |
| 1274 TestHelper("testResizeWebviewWithDisplayNoneResizesContent", | 1285 TestHelper("testResizeWebviewWithDisplayNoneResizesContent", |
| 1275 "web_view/shim", | 1286 "web_view/shim", |
| 1276 NO_TEST_SERVER); | 1287 NO_TEST_SERVER); |
| 1277 } | 1288 } |
| 1278 | 1289 |
| 1279 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestResizeWebviewResizesContent) { | 1290 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestResizeWebviewResizesContent) { |
| 1280 TestHelper("testResizeWebviewResizesContent", | 1291 TestHelper("testResizeWebviewResizesContent", |
| 1281 "web_view/shim", | 1292 "web_view/shim", |
| 1282 NO_TEST_SERVER); | 1293 NO_TEST_SERVER); |
| 1283 } | 1294 } |
| 1284 | 1295 |
| 1285 // This test makes sure the browser process does not crash if app is closed | 1296 // This test makes sure the browser process does not crash if app is closed |
| 1286 // while an interstitial page is being shown in guest. | 1297 // while an interstitial page is being shown in guest. |
| 1287 IN_PROC_BROWSER_TEST_F(WebViewTest, InterstitialTeardown) { | 1298 IN_PROC_BROWSER_TEST_F(WebViewTest, InterstitialTeardown) { |
| 1288 #if defined(OS_WIN) | 1299 #if defined(OS_WIN) |
| 1289 // Flaky on XP bot http://crbug.com/297014 | 1300 // Flaky on XP bot http://crbug.com/297014 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1570 GetGuestWebContents()->GetDelegate()->OpenURLFromTab( | 1581 GetGuestWebContents()->GetDelegate()->OpenURLFromTab( |
| 1571 GetGuestWebContents(), params); | 1582 GetGuestWebContents(), params); |
| 1572 | 1583 |
| 1573 ASSERT_TRUE(load_listener.WaitUntilSatisfied()); | 1584 ASSERT_TRUE(load_listener.WaitUntilSatisfied()); |
| 1574 | 1585 |
| 1575 // Verify that the <webview> ends up at about:blank. | 1586 // Verify that the <webview> ends up at about:blank. |
| 1576 EXPECT_EQ(GURL(url::kAboutBlankURL), | 1587 EXPECT_EQ(GURL(url::kAboutBlankURL), |
| 1577 GetGuestWebContents()->GetLastCommittedURL()); | 1588 GetGuestWebContents()->GetLastCommittedURL()); |
| 1578 } | 1589 } |
| 1579 | 1590 |
| 1580 IN_PROC_BROWSER_TEST_F(WebViewTest, OpenURLFromTab_NewWindow_Abort) { | 1591 IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest, OpenURLFromTab_NewWindow_Abort) { |
| 1581 LoadAppWithGuest("web_view/simple"); | 1592 LoadAppWithGuest("web_view/simple"); |
| 1582 | 1593 |
| 1583 // Verify that OpenURLFromTab with a window disposition of NEW_BACKGROUND_TAB | 1594 // Verify that OpenURLFromTab with a window disposition of NEW_BACKGROUND_TAB |
| 1584 // will trigger the <webview>'s New Window API. | 1595 // will trigger the <webview>'s New Window API. |
| 1585 ExtensionTestMessageListener new_window_listener( | 1596 ExtensionTestMessageListener new_window_listener( |
| 1586 "WebViewTest.NEWWINDOW", false); | 1597 "WebViewTest.NEWWINDOW", false); |
| 1587 | 1598 |
| 1588 // Navigating to a file URL is forbidden inside a <webview>. | 1599 // Navigating to a file URL is forbidden inside a <webview>. |
| 1589 content::OpenURLParams params(GURL("file://foo"), | 1600 content::OpenURLParams params(GURL("file://foo"), |
| 1590 content::Referrer(), | 1601 content::Referrer(), |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2121 IN_PROC_BROWSER_TEST_F(WebViewTest, SetPropertyOnDocumentReady) { | 2132 IN_PROC_BROWSER_TEST_F(WebViewTest, SetPropertyOnDocumentReady) { |
| 2122 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/document_ready")) | 2133 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/document_ready")) |
| 2123 << message_; | 2134 << message_; |
| 2124 } | 2135 } |
| 2125 | 2136 |
| 2126 IN_PROC_BROWSER_TEST_F(WebViewTest, SetPropertyOnDocumentInteractive) { | 2137 IN_PROC_BROWSER_TEST_F(WebViewTest, SetPropertyOnDocumentInteractive) { |
| 2127 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/document_interactive")) | 2138 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/document_interactive")) |
| 2128 << message_; | 2139 << message_; |
| 2129 } | 2140 } |
| 2130 | 2141 |
| 2131 IN_PROC_BROWSER_TEST_F(WebViewTest, SpeechRecognitionAPI_HasPermissionAllow) { | 2142 IN_PROC_BROWSER_TEST_F(WebViewSpeechAPITest, |
| 2143 SpeechRecognitionAPI_HasPermissionAllow) { |
| 2132 ASSERT_TRUE( | 2144 ASSERT_TRUE( |
| 2133 RunPlatformAppTestWithArg("platform_apps/web_view/speech_recognition_api", | 2145 RunPlatformAppTestWithArg("platform_apps/web_view/speech_recognition_api", |
| 2134 "allowTest")) | 2146 "allowTest")) |
| 2135 << message_; | 2147 << message_; |
| 2136 } | 2148 } |
| 2137 | 2149 |
| 2138 IN_PROC_BROWSER_TEST_F(WebViewTest, SpeechRecognitionAPI_HasPermissionDeny) { | 2150 IN_PROC_BROWSER_TEST_F(WebViewSpeechAPITest, |
| 2151 SpeechRecognitionAPI_HasPermissionDeny) { |
| 2139 ASSERT_TRUE( | 2152 ASSERT_TRUE( |
| 2140 RunPlatformAppTestWithArg("platform_apps/web_view/speech_recognition_api", | 2153 RunPlatformAppTestWithArg("platform_apps/web_view/speech_recognition_api", |
| 2141 "denyTest")) | 2154 "denyTest")) |
| 2142 << message_; | 2155 << message_; |
| 2143 } | 2156 } |
| 2144 | 2157 |
| 2145 IN_PROC_BROWSER_TEST_F(WebViewTest, SpeechRecognitionAPI_NoPermission) { | 2158 IN_PROC_BROWSER_TEST_F(WebViewSpeechAPITest, |
| 2159 SpeechRecognitionAPI_NoPermission) { |
| 2146 ASSERT_TRUE( | 2160 ASSERT_TRUE( |
| 2147 RunPlatformAppTestWithArg("platform_apps/web_view/common", | 2161 RunPlatformAppTestWithArg("platform_apps/web_view/common", |
| 2148 "speech_recognition_api_no_permission")) | 2162 "speech_recognition_api_no_permission")) |
| 2149 << message_; | 2163 << message_; |
| 2150 } | 2164 } |
| 2151 | 2165 |
| 2152 // Tests overriding user agent. | 2166 // Tests overriding user agent. |
| 2153 IN_PROC_BROWSER_TEST_F(WebViewTest, UserAgent) { | 2167 IN_PROC_BROWSER_TEST_F(WebViewTest, UserAgent) { |
| 2154 ASSERT_TRUE(RunPlatformAppTestWithArg( | 2168 ASSERT_TRUE(RunPlatformAppTestWithArg( |
| 2155 "platform_apps/web_view/common", "useragent")) << message_; | 2169 "platform_apps/web_view/common", "useragent")) << message_; |
| 2156 } | 2170 } |
| 2157 | 2171 |
| 2158 IN_PROC_BROWSER_TEST_F(WebViewTest, UserAgent_NewWindow) { | 2172 IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest, UserAgent_NewWindow) { |
| 2159 ASSERT_TRUE(RunPlatformAppTestWithArg( | 2173 ASSERT_TRUE(RunPlatformAppTestWithArg( |
| 2160 "platform_apps/web_view/common", | 2174 "platform_apps/web_view/common", |
| 2161 "useragent_newwindow")) << message_; | 2175 "useragent_newwindow")) << message_; |
| 2162 } | 2176 } |
| 2163 | 2177 |
| 2164 IN_PROC_BROWSER_TEST_F(WebViewTest, NoPermission) { | 2178 IN_PROC_BROWSER_TEST_F(WebViewTest, NoPermission) { |
| 2165 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/nopermission")) | 2179 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/nopermission")) |
| 2166 << message_; | 2180 << message_; |
| 2167 } | 2181 } |
| 2168 | 2182 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2251 | 2265 |
| 2252 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestFindAPI_findupdate) { | 2266 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestFindAPI_findupdate) { |
| 2253 TestHelper("testFindAPI_findupdate", "web_view/shim", NO_TEST_SERVER); | 2267 TestHelper("testFindAPI_findupdate", "web_view/shim", NO_TEST_SERVER); |
| 2254 } | 2268 } |
| 2255 | 2269 |
| 2256 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestLoadDataAPI) { | 2270 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestLoadDataAPI) { |
| 2257 TestHelper("testLoadDataAPI", "web_view/shim", NEEDS_TEST_SERVER); | 2271 TestHelper("testLoadDataAPI", "web_view/shim", NEEDS_TEST_SERVER); |
| 2258 } | 2272 } |
| 2259 | 2273 |
| 2260 // This test verifies that the resize and contentResize events work correctly. | 2274 // This test verifies that the resize and contentResize events work correctly. |
| 2261 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestResizeEvents) { | 2275 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestResizeEvents) { |
| 2262 TestHelper("testResizeEvents", "web_view/shim", NO_TEST_SERVER); | 2276 TestHelper("testResizeEvents", "web_view/shim", NO_TEST_SERVER); |
| 2263 } | 2277 } |
| 2264 | 2278 |
| 2265 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestPerOriginZoomMode) { | 2279 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestPerOriginZoomMode) { |
| 2266 TestHelper("testPerOriginZoomMode", "web_view/shim", NO_TEST_SERVER); | 2280 TestHelper("testPerOriginZoomMode", "web_view/shim", NO_TEST_SERVER); |
| 2267 } | 2281 } |
| 2268 | 2282 |
| 2269 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestPerViewZoomMode) { | 2283 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestPerViewZoomMode) { |
| 2270 TestHelper("testPerViewZoomMode", "web_view/shim", NO_TEST_SERVER); | 2284 TestHelper("testPerViewZoomMode", "web_view/shim", NO_TEST_SERVER); |
| 2271 } | 2285 } |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2537 // Generate and send synthetic touch event. | 2551 // Generate and send synthetic touch event. |
| 2538 FocusWaiter waiter(aura_webview); | 2552 FocusWaiter waiter(aura_webview); |
| 2539 content::SimulateTouchPressAt(GetEmbedderWebContents(), | 2553 content::SimulateTouchPressAt(GetEmbedderWebContents(), |
| 2540 guest_rect.CenterPoint()); | 2554 guest_rect.CenterPoint()); |
| 2541 | 2555 |
| 2542 // Wait for the TouchStart to propagate and restore focus. Test times out | 2556 // Wait for the TouchStart to propagate and restore focus. Test times out |
| 2543 // on failure. | 2557 // on failure. |
| 2544 waiter.Wait(); | 2558 waiter.Wait(); |
| 2545 } | 2559 } |
| 2546 #endif | 2560 #endif |
| OLD | NEW |