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/strings/stringprintf.h" | 5 #include "base/strings/stringprintf.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.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/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 NEEDS_TEST_SERVER); | 839 NEEDS_TEST_SERVER); |
840 } | 840 } |
841 | 841 |
842 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, | 842 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, |
843 NewWindow_WebRequestRemoveElement) { | 843 NewWindow_WebRequestRemoveElement) { |
844 TestHelper("testNewWindowWebRequestRemoveElement", | 844 TestHelper("testNewWindowWebRequestRemoveElement", |
845 "web_view/newwindow", | 845 "web_view/newwindow", |
846 NEEDS_TEST_SERVER); | 846 NEEDS_TEST_SERVER); |
847 } | 847 } |
848 | 848 |
| 849 // There is a problem of missing keyup events with the command key after |
| 850 // the NSEvent is sent to NSApplication in ui/base/test/ui_controls_mac.mm . |
| 851 // This test is disabled on only the Mac until the problem is resolved. |
| 852 // See http://crbug.com/425859 for more information. |
| 853 #if !defined(OS_MACOSX) |
849 // Tests that Ctrl+Click/Cmd+Click on a link fires up the newwindow API. | 854 // Tests that Ctrl+Click/Cmd+Click on a link fires up the newwindow API. |
850 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, NewWindow_OpenInNewTab) { | 855 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, NewWindow_OpenInNewTab) { |
851 content::WebContents* embedder_web_contents = NULL; | 856 content::WebContents* embedder_web_contents = NULL; |
852 | 857 |
853 ExtensionTestMessageListener loaded_listener("Loaded", false); | 858 ExtensionTestMessageListener loaded_listener("Loaded", false); |
854 scoped_ptr<ExtensionTestMessageListener> done_listener( | 859 scoped_ptr<ExtensionTestMessageListener> done_listener( |
855 RunAppHelper("testNewWindowOpenInNewTab", | 860 RunAppHelper("testNewWindowOpenInNewTab", |
856 "web_view/newwindow", | 861 "web_view/newwindow", |
857 NEEDS_TEST_SERVER, | 862 NEEDS_TEST_SERVER, |
858 &embedder_web_contents)); | 863 &embedder_web_contents)); |
859 | 864 |
860 loaded_listener.WaitUntilSatisfied(); | 865 loaded_listener.WaitUntilSatisfied(); |
861 #if defined(OS_MACOSX) | 866 #if defined(OS_MACOSX) |
862 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 867 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
863 GetPlatformAppWindow(), ui::VKEY_RETURN, | 868 GetPlatformAppWindow(), ui::VKEY_RETURN, |
864 false, false, false, true /* cmd */)); | 869 false, false, false, true /* cmd */)); |
865 #else | 870 #else |
866 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 871 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
867 GetPlatformAppWindow(), ui::VKEY_RETURN, | 872 GetPlatformAppWindow(), ui::VKEY_RETURN, |
868 true /* ctrl */, false, false, false)); | 873 true /* ctrl */, false, false, false)); |
869 #endif | 874 #endif |
870 | 875 |
871 // Wait for the embedder to receive a 'newwindow' event. | 876 // Wait for the embedder to receive a 'newwindow' event. |
872 ASSERT_TRUE(done_listener->WaitUntilSatisfied()); | 877 ASSERT_TRUE(done_listener->WaitUntilSatisfied()); |
873 } | 878 } |
| 879 #endif |
874 | 880 |
875 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, | 881 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, |
876 NewWindow_OpenerDestroyedWhileUnattached) { | 882 NewWindow_OpenerDestroyedWhileUnattached) { |
877 TestHelper("testNewWindowOpenerDestroyedWhileUnattached", | 883 TestHelper("testNewWindowOpenerDestroyedWhileUnattached", |
878 "web_view/newwindow", | 884 "web_view/newwindow", |
879 NEEDS_TEST_SERVER); | 885 NEEDS_TEST_SERVER); |
880 ASSERT_EQ(2u, GetGuestViewManager()->guest_add_count()); | 886 ASSERT_EQ(2u, GetGuestViewManager()->guest_add_count()); |
881 | 887 |
882 // We have two guests in this test, one is the intial one, the other | 888 // We have two guests in this test, one is the intial one, the other |
883 // is the newwindow one. | 889 // is the newwindow one. |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 | 1167 |
1162 // Now verify that the selection text propagates properly to RWHV. | 1168 // Now verify that the selection text propagates properly to RWHV. |
1163 content::RenderWidgetHostView* guest_rwhv = | 1169 content::RenderWidgetHostView* guest_rwhv = |
1164 guest_web_contents()->GetRenderWidgetHostView(); | 1170 guest_web_contents()->GetRenderWidgetHostView(); |
1165 ASSERT_TRUE(guest_rwhv); | 1171 ASSERT_TRUE(guest_rwhv); |
1166 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); | 1172 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); |
1167 ASSERT_TRUE(selected_text.size() >= 10u); | 1173 ASSERT_TRUE(selected_text.size() >= 10u); |
1168 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); | 1174 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); |
1169 } | 1175 } |
1170 #endif | 1176 #endif |
OLD | NEW |