Generate list of GPU contexts outside tests

Use DEF_GPUTEST_FOR_*_CONTEXT macros to obtain the
test GPU context.

Makes changing the context -related classes easier,
since not all tests need to be changed.

BUG=skia:2992

Review URL: https://codereview.chromium.org/1448873002
diff --git a/tests/ClipBoundsTest.cpp b/tests/ClipBoundsTest.cpp
index 781ee87..d8df62e 100644
--- a/tests/ClipBoundsTest.cpp
+++ b/tests/ClipBoundsTest.cpp
@@ -10,13 +10,11 @@
 // This is a GR test
 #if SK_SUPPORT_GPU
 #include "GrClipMaskManager.h"
-#include "GrContextFactory.h"
-#include "SkGpuDevice.h"
+#include "GrContext.h"
 
 // Ensure that the 'getConservativeBounds' calls are returning bounds clamped
 // to the render target
-static void test_clip_bounds(skiatest::Reporter* reporter, GrContext* context) {
-
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrClipBounds, reporter, context) {
     static const int kXSize = 100;
     static const int kYSize = 100;
 
@@ -68,18 +66,4 @@
     REPORTER_ASSERT(reporter, isIntersectionOfRects);
 }
 
-DEF_GPUTEST(GrClipBounds, reporter, factory) {
-    for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
-        GrContextFactory::GLContextType glType = static_cast<GrContextFactory::GLContextType>(type);
-        if (!GrContextFactory::IsRenderingGLContext(glType)) {
-            continue;
-        }
-        GrContext* context = factory->get(glType);
-        if (nullptr == context) {
-            continue;
-        }
-        test_clip_bounds(reporter, context);
-    }
-}
-
 #endif