Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ | 6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 // * when a value needs to be overridden by LayoutTests, WebTestProxy can | 295 // * when a value needs to be overridden by LayoutTests, WebTestProxy can |
| 296 // override RenderViewImpl's getter and call a getter from WebTestProxyBase | 296 // override RenderViewImpl's getter and call a getter from WebTestProxyBase |
| 297 // instead. In addition, WebTestProxyBase will have a public setter that | 297 // instead. In addition, WebTestProxyBase will have a public setter that |
| 298 // could be called from the TestRunner. | 298 // could be called from the TestRunner. |
| 299 #if defined(OS_WIN) | 299 #if defined(OS_WIN) |
| 300 // WebTestProxy is a diamond-shaped hierarchy, with WebWidgetClient at the root. | 300 // WebTestProxy is a diamond-shaped hierarchy, with WebWidgetClient at the root. |
| 301 // VS warns when we inherit the WebWidgetClient method implementations from | 301 // VS warns when we inherit the WebWidgetClient method implementations from |
| 302 // RenderWidget. It's safe to ignore that warning. | 302 // RenderWidget. It's safe to ignore that warning. |
| 303 #pragma warning(disable: 4250) | 303 #pragma warning(disable: 4250) |
| 304 #endif | 304 #endif |
| 305 template <class Base, typename T> | 305 template <class Base, typename... Args> |
|
its_nick_at_chromium_org
2015/07/21 22:08:04
Wat. Actually wait no, that's amazing.
One of the
| |
| 306 class WebTestProxy : public Base, public WebTestProxyBase { | 306 class WebTestProxy : public Base, public WebTestProxyBase { |
| 307 public: | 307 public: |
| 308 explicit WebTestProxy(T t) : Base(t) {} | 308 explicit WebTestProxy(Args... args) : Base(args...) {} |
| 309 | 309 |
| 310 // WebWidgetClient implementation. | 310 // WebWidgetClient implementation. |
| 311 virtual blink::WebScreenInfo screenInfo() { | 311 virtual blink::WebScreenInfo screenInfo() { |
| 312 blink::WebScreenInfo info = Base::screenInfo(); | 312 blink::WebScreenInfo info = Base::screenInfo(); |
| 313 WebTestProxyBase::GetScreenOrientationForTesting(info); | 313 WebTestProxyBase::GetScreenOrientationForTesting(info); |
| 314 return info; | 314 return info; |
| 315 } | 315 } |
| 316 | 316 |
| 317 // WebViewClient implementation. | 317 // WebViewClient implementation. |
| 318 virtual void scheduleAnimation() { WebTestProxyBase::ScheduleAnimation(); } | 318 virtual void scheduleAnimation() { WebTestProxyBase::ScheduleAnimation(); } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 | 393 |
| 394 private: | 394 private: |
| 395 virtual ~WebTestProxy() {} | 395 virtual ~WebTestProxy() {} |
| 396 | 396 |
| 397 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); | 397 DISALLOW_COPY_AND_ASSIGN(WebTestProxy); |
| 398 }; | 398 }; |
| 399 | 399 |
| 400 } // namespace test_runner | 400 } // namespace test_runner |
| 401 | 401 |
| 402 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ | 402 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_ |
| OLD | NEW |