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 <queue> | 5 #include <queue> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 protected: | 738 protected: |
739 void SetUpCommandLine(base::CommandLine* command_line) override { | 739 void SetUpCommandLine(base::CommandLine* command_line) override { |
740 WebViewTest::SetUpCommandLine(command_line); | 740 WebViewTest::SetUpCommandLine(command_line); |
741 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, | 741 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, |
742 base::StringPrintf("%f", scale())); | 742 base::StringPrintf("%f", scale())); |
743 } | 743 } |
744 | 744 |
745 static float scale() { return 2.0f; } | 745 static float scale() { return 2.0f; } |
746 }; | 746 }; |
747 | 747 |
| 748 class WebViewWithZoomForDSFTest : public WebViewTest { |
| 749 protected: |
| 750 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 751 WebViewTest::SetUpCommandLine(command_line); |
| 752 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, |
| 753 base::StringPrintf("%f", scale())); |
| 754 command_line->AppendSwitch(switches::kEnableUseZoomForDSF); |
| 755 } |
| 756 |
| 757 static float scale() { return 2.0f; } |
| 758 }; |
| 759 |
748 class WebContentsAudioMutedObserver : public content::WebContentsObserver { | 760 class WebContentsAudioMutedObserver : public content::WebContentsObserver { |
749 public: | 761 public: |
750 explicit WebContentsAudioMutedObserver(content::WebContents* web_contents) | 762 explicit WebContentsAudioMutedObserver(content::WebContents* web_contents) |
751 : WebContentsObserver(web_contents), | 763 : WebContentsObserver(web_contents), |
752 loop_runner_(new content::MessageLoopRunner), | 764 loop_runner_(new content::MessageLoopRunner), |
753 muting_update_observed_(false) {} | 765 muting_update_observed_(false) {} |
754 | 766 |
755 // WebContentsObserver. | 767 // WebContentsObserver. |
756 void DidUpdateAudioMutingState(bool muted) override { | 768 void DidUpdateAudioMutingState(bool muted) override { |
757 muting_update_observed_ = true; | 769 muting_update_observed_ = true; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 } | 944 } |
933 | 945 |
934 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAllowTransparencyAttribute) { | 946 IN_PROC_BROWSER_TEST_F(WebViewTest, Shim_TestAllowTransparencyAttribute) { |
935 TestHelper("testAllowTransparencyAttribute", "web_view/shim", NO_TEST_SERVER); | 947 TestHelper("testAllowTransparencyAttribute", "web_view/shim", NO_TEST_SERVER); |
936 } | 948 } |
937 | 949 |
938 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeHeight) { | 950 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeHeight) { |
939 TestHelper("testAutosizeHeight", "web_view/shim", NO_TEST_SERVER); | 951 TestHelper("testAutosizeHeight", "web_view/shim", NO_TEST_SERVER); |
940 } | 952 } |
941 | 953 |
| 954 IN_PROC_BROWSER_TEST_F(WebViewWithZoomForDSFTest, Shim_TestAutosizeHeight) { |
| 955 TestHelper("testAutosizeHeight", "web_view/shim", NO_TEST_SERVER); |
| 956 } |
| 957 |
942 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestAutosizeHeight) { | 958 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestAutosizeHeight) { |
943 TestHelper("testAutosizeHeight", "web_view/shim", NO_TEST_SERVER); | 959 TestHelper("testAutosizeHeight", "web_view/shim", NO_TEST_SERVER); |
944 } | 960 } |
945 | 961 |
946 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeBeforeNavigation) { | 962 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeBeforeNavigation) { |
947 TestHelper("testAutosizeBeforeNavigation", "web_view/shim", NO_TEST_SERVER); | 963 TestHelper("testAutosizeBeforeNavigation", "web_view/shim", NO_TEST_SERVER); |
948 } | 964 } |
949 | 965 |
| 966 IN_PROC_BROWSER_TEST_F(WebViewWithZoomForDSFTest, |
| 967 Shim_TestAutosizeBeforeNavigation) { |
| 968 TestHelper("testAutosizeBeforeNavigation", "web_view/shim", NO_TEST_SERVER); |
| 969 } |
| 970 |
950 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestAutosizeBeforeNavigation) { | 971 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestAutosizeBeforeNavigation) { |
951 TestHelper("testAutosizeBeforeNavigation", "web_view/shim", NO_TEST_SERVER); | 972 TestHelper("testAutosizeBeforeNavigation", "web_view/shim", NO_TEST_SERVER); |
952 } | 973 } |
953 | 974 |
954 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeRemoveAttributes) { | 975 IN_PROC_BROWSER_TEST_F(WebViewDPITest, Shim_TestAutosizeRemoveAttributes) { |
955 TestHelper("testAutosizeRemoveAttributes", "web_view/shim", NO_TEST_SERVER); | 976 TestHelper("testAutosizeRemoveAttributes", "web_view/shim", NO_TEST_SERVER); |
956 } | 977 } |
957 | 978 |
| 979 IN_PROC_BROWSER_TEST_F(WebViewWithZoomForDSFTest, |
| 980 Shim_TestAutosizeRemoveAttributes) { |
| 981 TestHelper("testAutosizeRemoveAttributes", "web_view/shim", NO_TEST_SERVER); |
| 982 } |
| 983 |
958 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestAutosizeRemoveAttributes) { | 984 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, Shim_TestAutosizeRemoveAttributes) { |
959 TestHelper("testAutosizeRemoveAttributes", "web_view/shim", NO_TEST_SERVER); | 985 TestHelper("testAutosizeRemoveAttributes", "web_view/shim", NO_TEST_SERVER); |
960 } | 986 } |
961 | 987 |
962 // This test is disabled due to being flaky. http://crbug.com/282116 | 988 // This test is disabled due to being flaky. http://crbug.com/282116 |
963 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, | 989 IN_PROC_BROWSER_TEST_F(WebViewSizeTest, |
964 DISABLED_Shim_TestAutosizeWithPartialAttributes) { | 990 DISABLED_Shim_TestAutosizeWithPartialAttributes) { |
965 TestHelper("testAutosizeWithPartialAttributes", | 991 TestHelper("testAutosizeWithPartialAttributes", |
966 "web_view/shim", | 992 "web_view/shim", |
967 NO_TEST_SERVER); | 993 NO_TEST_SERVER); |
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3020 // 4 tasks expected. The order is arbitrary. | 3046 // 4 tasks expected. The order is arbitrary. |
3021 // Tab: about:blank, | 3047 // Tab: about:blank, |
3022 // Background Page: <webview> task manager test, | 3048 // Background Page: <webview> task manager test, |
3023 // App: <webview> task manager test, | 3049 // App: <webview> task manager test, |
3024 // Webview: WebViewed test content. | 3050 // Webview: WebViewed test content. |
3025 EXPECT_EQ(4U, task_manager.tasks().size()); | 3051 EXPECT_EQ(4U, task_manager.tasks().size()); |
3026 EXPECT_TRUE(HasExpectedGuestTask(task_manager, guest_contents)); | 3052 EXPECT_TRUE(HasExpectedGuestTask(task_manager, guest_contents)); |
3027 } | 3053 } |
3028 | 3054 |
3029 #endif // defined(ENABLE_TASK_MANAGER) | 3055 #endif // defined(ENABLE_TASK_MANAGER) |
OLD | NEW |