blob: 99fa5d1f1ef3ca81cabae0fb07316bbb7912cdfb [file] [log] [blame]
David Ghandehari9e5b5872016-07-28 09:50:04 -07001// Copyright 2016 Google Inc. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#include "starboard/blitter.h"
16#include "starboard/nplb/blitter_helpers.h"
17#include "starboard/window.h"
18#include "testing/gtest/include/gtest/gtest.h"
19
20#if SB_HAS(BLITTER)
21
22namespace starboard {
23namespace nplb {
24namespace {
25
26TEST(SbBlitterDestroyContextTest, SunnyDay) {
27 SbBlitterDevice device = SbBlitterCreateDefaultDevice();
28 ASSERT_TRUE(SbBlitterIsDeviceValid(device));
29
30 SbBlitterContext context = SbBlitterCreateContext(device);
31 EXPECT_TRUE(SbBlitterIsContextValid(context));
32
33 EXPECT_TRUE(SbBlitterDestroyContext(context));
34 EXPECT_TRUE(SbBlitterDestroyDevice(device));
35}
36
37TEST(SbBlitterDestroyContextTest, RainyDayInvalidContext) {
38 EXPECT_FALSE(SbBlitterDestroyContext(kSbBlitterInvalidContext));
39}
40
41} // namespace
42} // namespace nplb
43} // namespace starboard
44
45#endif // SB_HAS(BLITTER)