summaryrefslogtreecommitdiffstats
path: root/content/common/gpu/client/gpu_in_process_context_tests.cc
blob: 6e740572211a8eb4d73fcd609fb062dc7fdb5229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stdio.h>
#include <cmath>
#include <string>
#include <vector>

#include "content/public/test/unittest_test_suite.h"
#include "gpu/blink/webgraphicscontext3d_in_process_command_buffer_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gl/gl_surface.h"

namespace {

using gpu_blink::WebGraphicsContext3DInProcessCommandBufferImpl;

class ContextTestBase : public testing::Test {
 public:
  void SetUp() override {
    blink::WebGraphicsContext3D::Attributes attributes;
    bool lose_context_when_out_of_memory = false;
    typedef WebGraphicsContext3DInProcessCommandBufferImpl WGC3DIPCBI;
    context_ = WGC3DIPCBI::CreateOffscreenContext(
        attributes, lose_context_when_out_of_memory);
    context_->InitializeOnCurrentThread();
    context_support_ = context_->GetContextSupport();
  }

  void TearDown() override { context_.reset(NULL); }

 protected:
  scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context_;
  gpu::ContextSupport* context_support_;
};

}  // namespace

// Include the actual tests.
#define CONTEXT_TEST_F TEST_F
#include "content/common/gpu/client/gpu_context_tests.h"