1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/android/android_image_reader_compat.h"
10 #include "base/android/build_info.h"
11 #include "testing/gtest/include/gtest/gtest.h"
16 class AndroidImageReaderTest : public testing::Test {
18 AndroidImageReaderTest() = default;
19 ~AndroidImageReaderTest() override = default;
22 // Getting instance of AndroidImageReader will invoke AndroidImageReader
23 // constructor which will dlopen the mediandk and androidndk .so files and do
24 // all the required symbol lookups.
25 TEST_F(AndroidImageReaderTest, GetImageReaderInstance) {
26 // It is expected that image reader support will be available from android
28 EXPECT_EQ(AndroidImageReader::GetInstance().IsSupported(),
29 base::android::BuildInfo::GetInstance()->sdk_int() >=
30 base::android::SDK_VERSION_P);
33 // There should be only 1 instance of AndroidImageReader im memory. Hence 2
34 // instances should have same memory address.
35 TEST_F(AndroidImageReaderTest, CompareImageReaderInstance) {
36 AndroidImageReader& a1 = AndroidImageReader::GetInstance();
37 AndroidImageReader& a2 = AndroidImageReader::GetInstance();
41 } // namespace android