Skip test GLPrograms test when GL or Gr context can't be created.

TBR: http://codereview.appspot.com/4946041/



git-svn-id: http://skia.googlecode.com/svn/trunk@2167 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/TestClassDef.h b/tests/TestClassDef.h
index 34f899f..ffef2a1 100644
--- a/tests/TestClassDef.h
+++ b/tests/TestClassDef.h
@@ -37,7 +37,9 @@
         protected:                                                          \
             virtual void onGetName(SkString* name) { name->set(uiname); }   \
             virtual void onRun(Reporter* reporter) {                        \
-                function(reporter, fContext);                               \
+                if (fContext) {                                             \
+                    function(reporter, fContext);                           \
+                }                                                           \
             }                                                               \
         };                                                                  \
         static TestRegistry gReg(classname::Factory);                       \