David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 1 | // 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 | |
| 22 | namespace starboard { |
| 23 | namespace nplb { |
| 24 | namespace { |
| 25 | |
| 26 | TEST(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 | |
| 37 | TEST(SbBlitterDestroyContextTest, RainyDayInvalidContext) { |
| 38 | EXPECT_FALSE(SbBlitterDestroyContext(kSbBlitterInvalidContext)); |
| 39 | } |
| 40 | |
| 41 | } // namespace |
| 42 | } // namespace nplb |
| 43 | } // namespace starboard |
| 44 | |
| 45 | #endif // SB_HAS(BLITTER) |