blob: 1d884acd9ce00c5e69b7ab348533f1703e96b0d0 [file] [log] [blame]
keyar@chromium.org5bdef292012-08-14 22:02:48 +00001/*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
keyar@chromium.org5bdef292012-08-14 22:02:48 +00008#if SK_SUPPORT_GPU
keyar@chromium.org5bdef292012-08-14 22:02:48 +00009
tfarina@chromium.org4ee16bf2014-01-10 22:08:27 +000010#include "GrContextFactory.h"
11#include "Test.h"
tfarina@chromium.org4ee16bf2014-01-10 22:08:27 +000012
tfarina9ea53f92014-06-24 06:50:39 -070013DEF_GPUTEST(GrContextFactory, reporter, factory) {
commit-bot@chromium.org197845a2013-04-19 13:24:28 +000014 // Reset in case some other test has been using it first.
tfarina@chromium.org4ee16bf2014-01-10 22:08:27 +000015 factory->destroyContexts();
keyar@chromium.org5bdef292012-08-14 22:02:48 +000016
17 // Before we ask for a context, we expect the GL context to not be there.
18 REPORTER_ASSERT(reporter,
bsalomone904c092014-07-17 10:50:59 -070019 NULL == factory->getGLContext(GrContextFactory::kNull_GLContextType));
keyar@chromium.org5bdef292012-08-14 22:02:48 +000020
21 // After we ask for a context, we expect that the GL context to be there.
bsalomone904c092014-07-17 10:50:59 -070022 factory->get(GrContextFactory::kNull_GLContextType);
keyar@chromium.org5bdef292012-08-14 22:02:48 +000023 REPORTER_ASSERT(reporter,
bsalomone904c092014-07-17 10:50:59 -070024 factory->getGLContext(GrContextFactory::kNull_GLContextType) != NULL);
keyar@chromium.org5bdef292012-08-14 22:02:48 +000025
26 // If we did not ask for a context with the particular GL context, we would
27 // expect the particular GL context to not be there.
28 REPORTER_ASSERT(reporter,
bsalomone904c092014-07-17 10:50:59 -070029 NULL == factory->getGLContext(GrContextFactory::kDebug_GLContextType));
keyar@chromium.org5bdef292012-08-14 22:02:48 +000030}
31
keyar@chromium.org5bdef292012-08-14 22:02:48 +000032#endif