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 #include "base/stringprintf.h" | 5 #include "base/stringprintf.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "chrome/browser/automation/automation_util.h" | 7 #include "chrome/browser/automation/automation_util.h" |
8 #include "chrome/browser/extensions/extension_test_message_listener.h" | 8 #include "chrome/browser/extensions/extension_test_message_listener.h" |
9 #include "chrome/browser/extensions/platform_app_browsertest_util.h" | 9 #include "chrome/browser/extensions/platform_app_browsertest_util.h" |
10 #include "chrome/browser/prerender/prerender_link_manager.h" | 10 #include "chrome/browser/prerender/prerender_link_manager.h" |
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 | 958 |
959 // Tests that | 959 // Tests that |
960 // BrowserPluginGeolocationPermissionContext::CancelGeolocationPermissionRequest | 960 // BrowserPluginGeolocationPermissionContext::CancelGeolocationPermissionRequest |
961 // is handled correctly (and does not crash). | 961 // is handled correctly (and does not crash). |
962 IN_PROC_BROWSER_TEST_F(WebViewTest, GeolocationAPICancelGeolocation) { | 962 IN_PROC_BROWSER_TEST_F(WebViewTest, GeolocationAPICancelGeolocation) { |
963 ASSERT_TRUE(StartTestServer()); // For serving guest pages. | 963 ASSERT_TRUE(StartTestServer()); // For serving guest pages. |
964 ASSERT_TRUE(RunPlatformAppTest( | 964 ASSERT_TRUE(RunPlatformAppTest( |
965 "platform_apps/web_view/geolocation/cancel_request")) << message_; | 965 "platform_apps/web_view/geolocation/cancel_request")) << message_; |
966 } | 966 } |
967 | 967 |
| 968 // Tests that setting focus on the <webview> sets focus on the guest. |
| 969 IN_PROC_BROWSER_TEST_F(WebViewTest, Focus) { |
| 970 ASSERT_TRUE(StartTestServer()); // For serving guest pages. |
| 971 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/focus")) |
| 972 << message_; |
| 973 } |
| 974 |
968 // Disabled on win debug bots due to flaky timeouts. | 975 // Disabled on win debug bots due to flaky timeouts. |
969 // See http://crbug.com/222618 . | 976 // See http://crbug.com/222618 . |
970 #if defined(OS_WIN) && !defined(NDEBUG) | 977 #if defined(OS_WIN) && !defined(NDEBUG) |
971 #define MAYBE_NewWindow DISABLED_NewWindow | 978 #define MAYBE_NewWindow DISABLED_NewWindow |
972 #else | 979 #else |
973 #define MAYBE_NewWindow NewWindow | 980 #define MAYBE_NewWindow NewWindow |
974 #endif | 981 #endif |
975 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_NewWindow) { | 982 IN_PROC_BROWSER_TEST_F(WebViewTest, MAYBE_NewWindow) { |
976 ASSERT_TRUE(StartTestServer()); // For serving guest pages. | 983 ASSERT_TRUE(StartTestServer()); // For serving guest pages. |
977 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/newwindow")) | 984 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/newwindow")) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 EXPECT_TRUE(content::ExecuteScript(guest_web_contents, | 1022 EXPECT_TRUE(content::ExecuteScript(guest_web_contents, |
1016 "startDownload('download-link-2')")); | 1023 "startDownload('download-link-2')")); |
1017 mock_delegate->WaitForCanDownload(true); // Expect to allow. | 1024 mock_delegate->WaitForCanDownload(true); // Expect to allow. |
1018 mock_delegate->Reset(); | 1025 mock_delegate->Reset(); |
1019 | 1026 |
1020 // 3. Guest requests a download that its embedder ignores, this implies deny. | 1027 // 3. Guest requests a download that its embedder ignores, this implies deny. |
1021 EXPECT_TRUE(content::ExecuteScript(guest_web_contents, | 1028 EXPECT_TRUE(content::ExecuteScript(guest_web_contents, |
1022 "startDownload('download-link-3')")); | 1029 "startDownload('download-link-3')")); |
1023 mock_delegate->WaitForCanDownload(false); // Expect to not allow. | 1030 mock_delegate->WaitForCanDownload(false); // Expect to not allow. |
1024 } | 1031 } |
OLD | NEW |