OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/message_loop/message_loop_proxy.h" | 6 #include "base/message_loop/message_loop_proxy.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "content/browser/gpu/compositor_util.h" | 9 #include "content/browser/gpu/compositor_util.h" |
10 #include "content/browser/gpu/gpu_data_manager_impl.h" | 10 #include "content/browser/gpu/gpu_data_manager_impl.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 if (!SetUpSourceSurface(wait_message)) { \ | 50 if (!SetUpSourceSurface(wait_message)) { \ |
51 LOG(WARNING) \ | 51 LOG(WARNING) \ |
52 << ("Blindly passing this test: This platform does not support " \ | 52 << ("Blindly passing this test: This platform does not support " \ |
53 "forced compositing (or forced-disabled compositing) mode."); \ | 53 "forced compositing (or forced-disabled compositing) mode."); \ |
54 return; \ | 54 return; \ |
55 } | 55 } |
56 | 56 |
57 // Convenience macro: Short-circuit a pass for platforms where setting up | 57 // Convenience macro: Short-circuit a pass for platforms where setting up |
58 // high-DPI fails. | 58 // high-DPI fails. |
59 #define PASS_TEST_IF_SCALE_FACTOR_NOT_SUPPORTED(factor) \ | 59 #define PASS_TEST_IF_SCALE_FACTOR_NOT_SUPPORTED(factor) \ |
60 if (ui::GetImageScale( \ | 60 if (ui::GetScaleForScaleFactor( \ |
61 GetScaleFactorForView(GetRenderWidgetHostViewPort())) != factor) { \ | 61 GetScaleFactorForView(GetRenderWidgetHostViewPort())) != factor) { \ |
62 LOG(WARNING) << "Blindly passing this test: failed to set up " \ | 62 LOG(WARNING) << "Blindly passing this test: failed to set up " \ |
63 "scale factor: " << factor; \ | 63 "scale factor: " << factor; \ |
64 return false; \ | 64 return false; \ |
65 } | 65 } |
66 | 66 |
67 // Common base class for browser tests. This is subclassed twice: Once to test | 67 // Common base class for browser tests. This is subclassed twice: Once to test |
68 // the browser in forced-compositing mode, and once to test with compositing | 68 // the browser in forced-compositing mode, and once to test with compositing |
69 // mode disabled. | 69 // mode disabled. |
70 class RenderWidgetHostViewBrowserTest : public ContentBrowserTest { | 70 class RenderWidgetHostViewBrowserTest : public ContentBrowserTest { |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 CompositingRenderWidgetHostViewBrowserTestTabCapture, | 946 CompositingRenderWidgetHostViewBrowserTestTabCapture, |
947 testing::ValuesIn(kAllCompositingModes)); | 947 testing::ValuesIn(kAllCompositingModes)); |
948 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, | 948 INSTANTIATE_TEST_CASE_P(GLAndSoftwareCompositing, |
949 CompositingRenderWidgetHostViewTabCaptureHighDPI, | 949 CompositingRenderWidgetHostViewTabCaptureHighDPI, |
950 testing::ValuesIn(kAllCompositingModes)); | 950 testing::ValuesIn(kAllCompositingModes)); |
951 | 951 |
952 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 952 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
953 | 953 |
954 } // namespace | 954 } // namespace |
955 } // namespace content | 955 } // namespace content |
OLD | NEW |