Code refactoring for end2end tests.

This change:
1) uses the new style ANGLE_SKIP_TEST_IF to skip tests.
2) replaces compile-time definition for OSX to skip tests by run-time
function IsOSX() to skip tests, in order to align with ANGLE_SKIP_TEST_IF.
3) fixes a couple of typos.

BUG=angleproject:2005

Change-Id: I5af77d82257536b9eb79e26afa502f5b91ff6d31
Reviewed-on: https://chromium-review.googlesource.com/915861
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/tests/gl_tests/WebGLCompatibilityTest.cpp b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
index dd6199e..b797028 100644
--- a/src/tests/gl_tests/WebGLCompatibilityTest.cpp
+++ b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
@@ -2161,11 +2161,8 @@
     GLint maxDrawBuffers = 0;
     glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
 
-    if (maxDrawBuffers < 2)
-    {
-        std::cout << "Test skipped because MAX_DRAW_BUFFERS is too small." << std::endl;
-        return;
-    }
+    // Test skipped because MAX_DRAW_BUFFERS is too small.
+    ANGLE_SKIP_TEST_IF(maxDrawBuffers < 2);
 
     ANGLE_GL_PROGRAM(program, vertexShader, fragmentShader);
     glUseProgram(program.get());
@@ -2334,12 +2331,7 @@
         glRequestExtensionANGLE("GL_EXT_texture_compression_dxt1");
     }
 
-    if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
-    {
-        std::cout << "Test skipped because GL_EXT_texture_compression_dxt1 is not available."
-                  << std::endl;
-        return;
-    }
+    ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_compression_dxt1"));
 
     constexpr uint8_t CompressedImageDXT1[] = {0x00, 0xf8, 0x00, 0xf8, 0xaa, 0xaa, 0xaa, 0xaa};
 
@@ -2594,11 +2586,7 @@
 
 TEST_P(WebGLCompatibilityTest, RGB32FTextures)
 {
-    if (IsLinux() && IsIntel())
-    {
-        std::cout << "Test skipped on Linux Intel." << std::endl;
-        return;
-    }
+    ANGLE_SKIP_TEST_IF(IsLinux() && IsIntel());
 
     constexpr float data[] = {1000.0f, -500.0f, 10.0f, 1.0f};
 
@@ -2769,11 +2757,7 @@
 
 TEST_P(WebGLCompatibilityTest, RGB16FTextures)
 {
-    if (IsOzone() && IsIntel())
-    {
-        std::cout << "Test skipped on Intel Ozone." << std::endl;
-        return;
-    }
+    ANGLE_SKIP_TEST_IF(IsOzone() && IsIntel());
 
     constexpr float readPixelsData[] = {7000.0f, 100.0f, 33.0f, 1.0f};
     const GLushort textureData[]     = {
@@ -2822,11 +2806,7 @@
 
 TEST_P(WebGLCompatibilityTest, RGBA16FTextures)
 {
-    if (IsOzone() && IsIntel())
-    {
-        std::cout << "Test skipped on Intel Ozone." << std::endl;
-        return;
-    }
+    ANGLE_SKIP_TEST_IF(IsOzone() && IsIntel());
 
     constexpr float readPixelsData[] = {7000.0f, 100.0f, 33.0f, -1.0f};
     const GLushort textureData[]     = {
@@ -2879,17 +2859,11 @@
 // accepted by glTexImage2D
 TEST_P(WebGLCompatibilityTest, SizedRGBA32FFormats)
 {
-    if (getClientMajorVersion() != 2)
-    {
-        std::cout << "Test skipped because it is only valid for WebGL1 contexts." << std::endl;
-        return;
-    }
+    // Test skipped because it is only valid for WebGL1 contexts.
+    ANGLE_SKIP_TEST_IF(getClientMajorVersion() != 2);
 
-    if (!extensionRequestable("GL_OES_texture_float"))
-    {
-        std::cout << "Test skipped because GL_OES_texture_float is not requestable." << std::endl;
-        return;
-    }
+    ANGLE_SKIP_TEST_IF(!extensionRequestable("GL_OES_texture_float"));
+
     glRequestExtensionANGLE("GL_OES_texture_float");
     ASSERT_GL_NO_ERROR();
 
@@ -3213,11 +3187,8 @@
 // the buffer type.
 TEST_P(WebGL2CompatibilityTest, ClearBufferTypeCompatibity)
 {
-    if (IsD3D11())
-    {
-        std::cout << "Test skipped because it generates D3D11 runtime warnings." << std::endl;
-        return;
-    }
+    // Test skipped for D3D11 because it generates D3D11 runtime warnings.
+    ANGLE_SKIP_TEST_IF(IsD3D11());
 
     constexpr float clearFloat[]       = {0.0f, 0.0f, 0.0f, 0.0f};
     constexpr int clearInt[]           = {0, 0, 0, 0};
@@ -3581,11 +3552,7 @@
     bool useEXT = false;
     if (getClientMajorVersion() < 3)
     {
-        if (!extensionRequestable("GL_EXT_draw_buffers"))
-        {
-            std::cout << "Test skipped because draw buffers are not available" << std::endl;
-            return;
-        }
+        ANGLE_SKIP_TEST_IF(!extensionRequestable("GL_EXT_draw_buffers"));
 
         glRequestExtensionANGLE("GL_EXT_draw_buffers");
         useEXT = true;
@@ -3594,11 +3561,8 @@
 
     GLint maxDrawBuffers = 0;
     glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
-    if (maxDrawBuffers < 4)
-    {
-        std::cout << "Test skipped because MAX_DRAW_BUFFERS is too small." << std::endl;
-        return;
-    }
+    // Test skipped because MAX_DRAW_BUFFERS is too small.
+    ANGLE_SKIP_TEST_IF(maxDrawBuffers < 4);
 
     // Clears all the renderbuffers to red.
     auto ClearEverythingToRed = [](GLRenderbuffer *renderbuffers) {