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 "base/path_service.h" | 5 #include "base/path_service.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/apps/app_browsertest_util.h" | 8 #include "chrome/browser/apps/app_browsertest_util.h" |
9 #include "chrome/browser/chrome_content_browser_client.h" | 9 #include "chrome/browser/chrome_content_browser_client.h" |
10 #include "chrome/browser/prerender/prerender_link_manager.h" | 10 #include "chrome/browser/prerender/prerender_link_manager.h" |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 GetEmbedderWebContents()->GetController().Reload(false); | 764 GetEmbedderWebContents()->GetController().Reload(false); |
765 ASSERT_TRUE(launched_again_listener.WaitUntilSatisfied()); | 765 ASSERT_TRUE(launched_again_listener.WaitUntilSatisfied()); |
766 } | 766 } |
767 | 767 |
768 IN_PROC_BROWSER_TEST_F(WebViewTest, AcceptTouchEvents) { | 768 IN_PROC_BROWSER_TEST_F(WebViewTest, AcceptTouchEvents) { |
769 LoadAppWithGuest("web_view/accept_touch_events"); | 769 LoadAppWithGuest("web_view/accept_touch_events"); |
770 | 770 |
771 content::RenderViewHost* embedder_rvh = | 771 content::RenderViewHost* embedder_rvh = |
772 GetEmbedderWebContents()->GetRenderViewHost(); | 772 GetEmbedderWebContents()->GetRenderViewHost(); |
773 | 773 |
774 bool embedder_has_touch_handler = | 774 bool embedder_will_forward_touch_events = |
775 content::RenderViewHostTester::HasTouchEventHandler(embedder_rvh); | 775 content::RenderViewHostTester::WillForwardTouchEvents(embedder_rvh); |
776 EXPECT_FALSE(embedder_has_touch_handler); | 776 EXPECT_FALSE(embedder_will_forward_touch_events); |
777 | 777 |
778 SendMessageToGuestAndWait("install-touch-handler", "installed-touch-handler"); | 778 SendMessageToGuestAndWait("install-touch-handler", "installed-touch-handler"); |
779 | 779 |
780 // Note that we need to wait for the installed/registered touch handler to | 780 // Note that we need to wait for the installed/registered touch handler to |
781 // appear in browser process before querying |embedder_rvh|. | 781 // appear in browser process before querying |embedder_rvh|. |
782 // In practice, since we do a roundrtip from browser process to guest and | 782 // In practice, since we do a roundtrip from browser process to guest and |
783 // back, this is sufficient. | 783 // back, this is sufficient. |
784 embedder_has_touch_handler = | 784 embedder_will_forward_touch_events = |
785 content::RenderViewHostTester::HasTouchEventHandler(embedder_rvh); | 785 content::RenderViewHostTester::WillForwardTouchEvents(embedder_rvh); |
786 EXPECT_TRUE(embedder_has_touch_handler); | 786 EXPECT_TRUE(embedder_will_forward_touch_events); |
787 | 787 |
788 SendMessageToGuestAndWait("uninstall-touch-handler", | 788 SendMessageToGuestAndWait("uninstall-touch-handler", |
789 "uninstalled-touch-handler"); | 789 "uninstalled-touch-handler"); |
790 // Same as the note above about waiting. | 790 // Same as the note above about waiting. |
791 embedder_has_touch_handler = | 791 embedder_will_forward_touch_events = |
792 content::RenderViewHostTester::HasTouchEventHandler(embedder_rvh); | 792 content::RenderViewHostTester::WillForwardTouchEvents(embedder_rvh); |
793 EXPECT_FALSE(embedder_has_touch_handler); | 793 EXPECT_FALSE(embedder_will_forward_touch_events); |
794 } | 794 } |
795 | 795 |
796 // This test ensures JavaScript errors ("Cannot redefine property") do not | 796 // This test ensures JavaScript errors ("Cannot redefine property") do not |
797 // happen when a <webview> is removed from DOM and added back. | 797 // happen when a <webview> is removed from DOM and added back. |
798 IN_PROC_BROWSER_TEST_F(WebViewTest, | 798 IN_PROC_BROWSER_TEST_F(WebViewTest, |
799 AddRemoveWebView_AddRemoveWebView) { | 799 AddRemoveWebView_AddRemoveWebView) { |
800 ASSERT_TRUE(StartEmbeddedTestServer()); // For serving guest pages. | 800 ASSERT_TRUE(StartEmbeddedTestServer()); // For serving guest pages. |
801 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/addremove")) | 801 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/addremove")) |
802 << message_; | 802 << message_; |
803 } | 803 } |
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2307 // http://crbug.com/403325 | 2307 // http://crbug.com/403325 |
2308 #define MAYBE_WebViewInBackgroundPage \ | 2308 #define MAYBE_WebViewInBackgroundPage \ |
2309 DISABLED_WebViewInBackgroundPage | 2309 DISABLED_WebViewInBackgroundPage |
2310 #else | 2310 #else |
2311 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage | 2311 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage |
2312 #endif | 2312 #endif |
2313 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { | 2313 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { |
2314 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) | 2314 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) |
2315 << message_; | 2315 << message_; |
2316 } | 2316 } |
OLD | NEW |