Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: chrome/browser/apps/web_view_browsertest.cc

Issue 660663002: Clear pending events upon main frame navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 GetEmbedderWebContents()->GetController().Reload(false); 760 GetEmbedderWebContents()->GetController().Reload(false);
761 ASSERT_TRUE(launched_again_listener.WaitUntilSatisfied()); 761 ASSERT_TRUE(launched_again_listener.WaitUntilSatisfied());
762 } 762 }
763 763
764 IN_PROC_BROWSER_TEST_F(WebViewTest, AcceptTouchEvents) { 764 IN_PROC_BROWSER_TEST_F(WebViewTest, AcceptTouchEvents) {
765 LoadAppWithGuest("web_view/accept_touch_events"); 765 LoadAppWithGuest("web_view/accept_touch_events");
766 766
767 content::RenderViewHost* embedder_rvh = 767 content::RenderViewHost* embedder_rvh =
768 GetEmbedderWebContents()->GetRenderViewHost(); 768 GetEmbedderWebContents()->GetRenderViewHost();
769 769
770 bool embedder_has_touch_handler = 770 bool embedder_will_forward_touch_events =
771 content::RenderViewHostTester::HasTouchEventHandler(embedder_rvh); 771 content::RenderViewHostTester::WillForwardTouchEvents(embedder_rvh);
772 EXPECT_FALSE(embedder_has_touch_handler); 772 EXPECT_FALSE(embedder_will_forward_touch_events);
773 773
774 SendMessageToGuestAndWait("install-touch-handler", "installed-touch-handler"); 774 SendMessageToGuestAndWait("install-touch-handler", "installed-touch-handler");
775 775
776 // Note that we need to wait for the installed/registered touch handler to 776 // Note that we need to wait for the installed/registered touch handler to
777 // appear in browser process before querying |embedder_rvh|. 777 // appear in browser process before querying |embedder_rvh|.
778 // In practice, since we do a roundrtip from browser process to guest and 778 // In practice, since we do a roundtrip from browser process to guest and
779 // back, this is sufficient. 779 // back, this is sufficient.
780 embedder_has_touch_handler = 780 embedder_will_forward_touch_events =
781 content::RenderViewHostTester::HasTouchEventHandler(embedder_rvh); 781 content::RenderViewHostTester::WillForwardTouchEvents(embedder_rvh);
782 EXPECT_TRUE(embedder_has_touch_handler); 782 EXPECT_TRUE(embedder_will_forward_touch_events);
783 783
784 SendMessageToGuestAndWait("uninstall-touch-handler", 784 SendMessageToGuestAndWait("uninstall-touch-handler",
785 "uninstalled-touch-handler"); 785 "uninstalled-touch-handler");
786 // Same as the note above about waiting. 786 // Same as the note above about waiting.
787 embedder_has_touch_handler = 787 embedder_will_forward_touch_events =
788 content::RenderViewHostTester::HasTouchEventHandler(embedder_rvh); 788 content::RenderViewHostTester::WillForwardTouchEvents(embedder_rvh);
789 EXPECT_FALSE(embedder_has_touch_handler); 789 EXPECT_FALSE(embedder_will_forward_touch_events);
790 } 790 }
791 791
792 // This test ensures JavaScript errors ("Cannot redefine property") do not 792 // This test ensures JavaScript errors ("Cannot redefine property") do not
793 // happen when a <webview> is removed from DOM and added back. 793 // happen when a <webview> is removed from DOM and added back.
794 IN_PROC_BROWSER_TEST_F(WebViewTest, 794 IN_PROC_BROWSER_TEST_F(WebViewTest,
795 AddRemoveWebView_AddRemoveWebView) { 795 AddRemoveWebView_AddRemoveWebView) {
796 ASSERT_TRUE(StartEmbeddedTestServer()); // For serving guest pages. 796 ASSERT_TRUE(StartEmbeddedTestServer()); // For serving guest pages.
797 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/addremove")) 797 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/addremove"))
798 << message_; 798 << message_;
799 } 799 }
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2301 // http://crbug.com/403325 2301 // http://crbug.com/403325
2302 #define MAYBE_WebViewInBackgroundPage \ 2302 #define MAYBE_WebViewInBackgroundPage \
2303 DISABLED_WebViewInBackgroundPage 2303 DISABLED_WebViewInBackgroundPage
2304 #else 2304 #else
2305 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage 2305 #define MAYBE_WebViewInBackgroundPage WebViewInBackgroundPage
2306 #endif 2306 #endif
2307 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) { 2307 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_WebViewInBackgroundPage) {
2308 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background")) 2308 ASSERT_TRUE(RunExtensionTest("platform_apps/web_view/background"))
2309 << message_; 2309 << message_;
2310 } 2310 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698