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 "apps/native_app_window.h" | 5 #include "apps/native_app_window.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/automation/automation_util.h" | 9 #include "chrome/browser/automation/automation_util.h" |
10 #include "chrome/browser/extensions/extension_test_message_listener.h" | 10 #include "chrome/browser/extensions/extension_test_message_listener.h" |
11 #include "chrome/browser/prerender/prerender_link_manager.h" | 11 #include "chrome/browser/prerender/prerender_link_manager.h" |
12 #include "chrome/browser/prerender/prerender_link_manager_factory.h" | 12 #include "chrome/browser/prerender/prerender_link_manager_factory.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
| 18 #include "content/public/browser/gpu_data_manager.h" |
18 #include "content/public/browser/interstitial_page.h" | 19 #include "content/public/browser/interstitial_page.h" |
19 #include "content/public/browser/interstitial_page_delegate.h" | 20 #include "content/public/browser/interstitial_page_delegate.h" |
20 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
21 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
22 #include "content/public/browser/web_contents_delegate.h" | 23 #include "content/public/browser/web_contents_delegate.h" |
23 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
24 #include "content/public/test/browser_test_utils.h" | 25 #include "content/public/test/browser_test_utils.h" |
25 #include "content/public/test/fake_speech_recognition_manager.h" | 26 #include "content/public/test/fake_speech_recognition_manager.h" |
26 #include "net/test/embedded_test_server/embedded_test_server.h" | 27 #include "net/test/embedded_test_server/embedded_test_server.h" |
27 #include "net/test/embedded_test_server/http_request.h" | 28 #include "net/test/embedded_test_server/http_request.h" |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 #if !defined(OS_CHROMEOS) | 588 #if !defined(OS_CHROMEOS) |
588 // This test ensures <webview> doesn't crash in SW rendering when autosize is | 589 // This test ensures <webview> doesn't crash in SW rendering when autosize is |
589 // turned on. | 590 // turned on. |
590 IN_PROC_BROWSER_TEST_F(WebViewTest, AutoSizeSW) { | 591 IN_PROC_BROWSER_TEST_F(WebViewTest, AutoSizeSW) { |
591 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/autosize")) | 592 ASSERT_TRUE(RunPlatformAppTest("platform_apps/web_view/autosize")) |
592 << message_; | 593 << message_; |
593 } | 594 } |
594 #endif | 595 #endif |
595 | 596 |
596 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAutosizeAfterNavigation) { | 597 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAutosizeAfterNavigation) { |
| 598 #if defined(USE_AURA) |
| 599 // TODO(gab): Fix this test in software compositing mode: |
| 600 // http://crbug.com/295801. |
| 601 if (!content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) |
| 602 return; |
| 603 #endif |
597 TestHelper("testAutosizeAfterNavigation", | 604 TestHelper("testAutosizeAfterNavigation", |
598 "DoneShimTest.PASSED", | 605 "DoneShimTest.PASSED", |
599 "DoneShimTest.FAILED", | 606 "DoneShimTest.FAILED", |
600 "web_view/shim"); | 607 "web_view/shim"); |
601 } | 608 } |
602 | 609 |
603 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAutosizeBeforeNavigation) { | 610 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAutosizeBeforeNavigation) { |
| 611 #if defined(USE_AURA) |
| 612 // TODO(gab): Fix this test in software compositing mode: |
| 613 // http://crbug.com/295801. |
| 614 if (!content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) |
| 615 return; |
| 616 #endif |
604 TestHelper("testAutosizeBeforeNavigation", | 617 TestHelper("testAutosizeBeforeNavigation", |
605 "DoneShimTest.PASSED", | 618 "DoneShimTest.PASSED", |
606 "DoneShimTest.FAILED", | 619 "DoneShimTest.FAILED", |
607 "web_view/shim"); | 620 "web_view/shim"); |
608 } | 621 } |
609 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAutosizeRemoveAttributes) { | 622 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAutosizeRemoveAttributes) { |
| 623 #if defined(USE_AURA) |
| 624 // TODO(gab): Fix this test in software compositing mode: |
| 625 // http://crbug.com/295801. |
| 626 if (!content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) |
| 627 return; |
| 628 #endif |
610 TestHelper("testAutosizeRemoveAttributes", | 629 TestHelper("testAutosizeRemoveAttributes", |
611 "DoneShimTest.PASSED", | 630 "DoneShimTest.PASSED", |
612 "DoneShimTest.FAILED", | 631 "DoneShimTest.FAILED", |
613 "web_view/shim"); | 632 "web_view/shim"); |
614 } | 633 } |
615 | 634 |
616 // This test is disabled due to being flaky. http://crbug.com/282116 | 635 // This test is disabled due to being flaky. http://crbug.com/282116 |
617 #if defined(OS_WIN) | 636 #if defined(OS_WIN) |
618 #define MAYBE_Shim_TestAutosizeWithPartialAttributes \ | 637 #define MAYBE_Shim_TestAutosizeWithPartialAttributes \ |
619 DISABLED_Shim_TestAutosizeWithPartialAttributes | 638 DISABLED_Shim_TestAutosizeWithPartialAttributes |
620 #else | 639 #else |
621 #define MAYBE_Shim_TestAutosizeWithPartialAttributes \ | 640 #define MAYBE_Shim_TestAutosizeWithPartialAttributes \ |
622 Shim_TestAutosizeWithPartialAttributes | 641 Shim_TestAutosizeWithPartialAttributes |
623 #endif | 642 #endif |
624 IN_PROC_BROWSER_TEST_F(WebViewTest, | 643 IN_PROC_BROWSER_TEST_F(WebViewTest, |
625 MAYBE_Shim_TestAutosizeWithPartialAttributes) { | 644 MAYBE_Shim_TestAutosizeWithPartialAttributes) { |
| 645 #if defined(USE_AURA) |
| 646 // TODO(gab): Fix this test in software compositing mode: |
| 647 // http://crbug.com/295801. |
| 648 if (!content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) |
| 649 return; |
| 650 #endif |
626 TestHelper("testAutosizeWithPartialAttributes", | 651 TestHelper("testAutosizeWithPartialAttributes", |
627 "DoneShimTest.PASSED", | 652 "DoneShimTest.PASSED", |
628 "DoneShimTest.FAILED", | 653 "DoneShimTest.FAILED", |
629 "web_view/shim"); | 654 "web_view/shim"); |
630 } | 655 } |
631 | 656 |
632 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAPIMethodExistence) { | 657 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAPIMethodExistence) { |
633 TestHelper("testAPIMethodExistence", | 658 TestHelper("testAPIMethodExistence", |
634 "DoneShimTest.PASSED", | 659 "DoneShimTest.PASSED", |
635 "DoneShimTest.FAILED", | 660 "DoneShimTest.FAILED", |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 } | 956 } |
932 | 957 |
933 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestNavigationToExternalProtocol) { | 958 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestNavigationToExternalProtocol) { |
934 TestHelper("testNavigationToExternalProtocol", | 959 TestHelper("testNavigationToExternalProtocol", |
935 "DoneShimTest.PASSED", | 960 "DoneShimTest.PASSED", |
936 "DoneShimTest.FAILED", | 961 "DoneShimTest.FAILED", |
937 "web_view/shim"); | 962 "web_view/shim"); |
938 } | 963 } |
939 | 964 |
940 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestResizeWebviewResizesContent) { | 965 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestResizeWebviewResizesContent) { |
| 966 #if defined(USE_AURA) |
| 967 // TODO(gab): Fix this test in software compositing mode: |
| 968 // http://crbug.com/295801. |
| 969 if (!content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) |
| 970 return; |
| 971 #endif |
941 TestHelper("testResizeWebviewResizesContent", | 972 TestHelper("testResizeWebviewResizesContent", |
942 "DoneShimTest.PASSED", | 973 "DoneShimTest.PASSED", |
943 "DoneShimTest.FAILED", | 974 "DoneShimTest.FAILED", |
944 "web_view/shim"); | 975 "web_view/shim"); |
945 } | 976 } |
946 | 977 |
947 // This test makes sure we do not crash if app is closed while interstitial | 978 // This test makes sure we do not crash if app is closed while interstitial |
948 // page is being shown in guest. | 979 // page is being shown in guest. |
949 IN_PROC_BROWSER_TEST_F(WebViewTest, InterstitialTeardown) { | 980 IN_PROC_BROWSER_TEST_F(WebViewTest, InterstitialTeardown) { |
950 // Start a HTTPS server so we can load an interstitial page inside guest. | 981 // Start a HTTPS server so we can load an interstitial page inside guest. |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 "DoneDialogTest.FAILED", | 1763 "DoneDialogTest.FAILED", |
1733 "web_view/dialog"); | 1764 "web_view/dialog"); |
1734 } | 1765 } |
1735 | 1766 |
1736 IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) { | 1767 IN_PROC_BROWSER_TEST_F(WebViewTest, Dialog_TestPromptDialog) { |
1737 TestHelper("testPromptDialog", | 1768 TestHelper("testPromptDialog", |
1738 "DoneDialogTest.PASSED", | 1769 "DoneDialogTest.PASSED", |
1739 "DoneDialogTest.FAILED", | 1770 "DoneDialogTest.FAILED", |
1740 "web_view/dialog"); | 1771 "web_view/dialog"); |
1741 } | 1772 } |
OLD | NEW |