Revert "Revert "Make mock GrContext unit testable.""

This reverts commit c867a89b012c07e7e5cb719a31ed90e61f4a4901.

Reason for revert: test

Original change's description:
> Revert "Make mock GrContext unit testable."
> 
> This reverts commit 993e7e25217df05d63c3354c817e8bd18ea3738b.
> 
> Reason for revert: Seeing if this fixes the NexusPlayer bots
> 
> Original change's description:
> > Make mock GrContext unit testable.
> > 
> > Bug: skia:
> > Change-Id: I959122f1f2c390832ab1033bcdbdd2ca6cfc0419
> > Reviewed-on: https://skia-review.googlesource.com/20699
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: I25ed9329962d930fe38108f779ff7083e0e4847e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/21731
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I62c579e087db1ff9891cf6c41b3eb40f47561887
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/21733
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index 23ffad1..d614b06 100644
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -22,6 +22,7 @@
 #endif
 #include "gl/null/NullGLTestContext.h"
 #include "gl/GrGLGpu.h"
+#include "mock/MockTestContext.h"
 #include "GrCaps.h"
 
 #if defined(SK_BUILD_FOR_WIN32) && defined(SK_ENABLE_DISCRETE_GPU)
@@ -220,6 +221,19 @@
             break;
         }
 #endif
+        case kMock_GrBackend: {
+            TestContext* sharedContext = masterContext ? masterContext->fTestContext : nullptr;
+            SkASSERT(kMock_ContextType == type);
+            if (ContextOverrides::kRequireNVPRSupport & overrides) {
+                return ContextInfo();
+            }
+            testCtx.reset(CreateMockTestContext(sharedContext));
+            if (!testCtx) {
+                return ContextInfo();
+            }
+            backendContext = testCtx->backendContext();
+            break;
+        }
         default:
             return ContextInfo();
     }