| 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 IOS_WEB_PUBLIC_TEST_WEB_TEST_UTIL_H_ | 5 #ifndef IOS_WEB_PUBLIC_TEST_WEB_TEST_UTIL_H_ |
| 6 #define IOS_WEB_PUBLIC_TEST_WEB_TEST_UTIL_H_ | 6 #define IOS_WEB_PUBLIC_TEST_WEB_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include "ios/web/web_view_util.h" | 8 #include "ios/web/public/web_view_util.h" |
| 9 | 9 |
| 10 // A helper macro that allows skipping a unit test on iOS7 and earlier. Example: | 10 // A helper macro that allows skipping a unit test on iOS7 and earlier. Example: |
| 11 // | 11 // |
| 12 // TEST_F(WKWebViewTest, WebViewInitializesCorrectly) { | 12 // TEST_F(WKWebViewTest, WebViewInitializesCorrectly) { |
| 13 // CR_TEST_REQUIRES_WK_WEB_VIEW(); | 13 // CR_TEST_REQUIRES_WK_WEB_VIEW(); |
| 14 // EXPECT_TRUE(NSClassFromString(@"WKWebView") != nil); | 14 // EXPECT_TRUE(NSClassFromString(@"WKWebView") != nil); |
| 15 // } | 15 // } |
| 16 #define CR_TEST_REQUIRES_WK_WEB_VIEW() \ | 16 #define CR_TEST_REQUIRES_WK_WEB_VIEW() \ |
| 17 if (!web::IsWKWebViewSupported()) \ | 17 if (!web::IsWKWebViewSupported()) \ |
| 18 return | 18 return |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 typedef WEB_TEST_BASE_CLASS_( \ | 67 typedef WEB_TEST_BASE_CLASS_( \ |
| 68 ui_fixture, wk_fixture, \ | 68 ui_fixture, wk_fixture, \ |
| 69 test_name) <wk_fixture> WEB_TEST_TEST_CLASS_(wk_fixture, test_name); \ | 69 test_name) <wk_fixture> WEB_TEST_TEST_CLASS_(wk_fixture, test_name); \ |
| 70 GTEST_WEB_TEST_(ui_fixture, test_name, false) \ | 70 GTEST_WEB_TEST_(ui_fixture, test_name, false) \ |
| 71 GTEST_WEB_TEST_(wk_fixture, test_name, true) \ | 71 GTEST_WEB_TEST_(wk_fixture, test_name, true) \ |
| 72 template <typename T> \ | 72 template <typename T> \ |
| 73 void WEB_TEST_BASE_CLASS_(ui_fixture, wk_fixture, \ | 73 void WEB_TEST_BASE_CLASS_(ui_fixture, wk_fixture, \ |
| 74 test_name) <T>::WebTestBody() | 74 test_name) <T>::WebTestBody() |
| 75 | 75 |
| 76 #endif // IOS_WEB_PUBLIC_TEST_WEB_TEST_UTIL_H_ | 76 #endif // IOS_WEB_PUBLIC_TEST_WEB_TEST_UTIL_H_ |
| OLD | NEW |