Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions testing/integration_tests/admob/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.admob.testapp"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28" />
<application android:label="@string/app_name">
<!-- You may replace the sample Admob App ID below with your own App ID. -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
<activity android:name="android.app.NativeActivity"
android:screenOrientation="portrait"
android:configChanges="orientation|screenSize">
<meta-data android:name="android.app.lib_name"
android:value="android_integration_test_main" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="com.google.intent.action.TEST_LOOP"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/javascript"/>
</intent-filter>
</activity>
<meta-data android:name="com.google.test.loops" android:value="1" />
</application>
</manifest>
196 changes: 196 additions & 0 deletions testing/integration_tests/admob/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
cmake_minimum_required(VERSION 2.8)

# User settings for Firebase integration tests.
# Path to Firebase SDK.
# Try to read the path to the Firebase C++ SDK from an environment variable.
if (NOT "$ENV{FIREBASE_CPP_SDK_DIR}" STREQUAL "")
set(DEFAULT_FIREBASE_CPP_SDK_DIR "$ENV{FIREBASE_CPP_SDK_DIR}")
else()
set(DEFAULT_FIREBASE_CPP_SDK_DIR "firebase_cpp_sdk")
endif()
if ("${FIREBASE_CPP_SDK_DIR}" STREQUAL "")
set(FIREBASE_CPP_SDK_DIR ${DEFAULT_FIREBASE_CPP_SDK_DIR})
endif()
if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR})
message(FATAL_ERROR "The Firebase C++ SDK directory does not exist: ${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information")
endif()

# Windows runtime mode, either MD or MT depending on whether you are using
# /MD or /MT. For more information see:
# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
set(MSVC_RUNTIME_MODE MD)

project(firebase_testapp)

# Integration test source files.
set(FIREBASE_APP_FRAMEWORK_SRCS
src/app_framework.cc
src/app_framework.h
)

set(FIREBASE_TEST_FRAMEWORK_SRCS
src/firebase_test_framework.h
src/firebase_test_framework.cc
)

set(FIREBASE_INTEGRATION_TEST_SRCS
src/integration_test.cc
)

# The include directory for the testapp.
include_directories(src)

# Integration test uses some features that require C++ 11, such as lambdas.
set (CMAKE_CXX_STANDARD 11)

# Download and unpack googletest (and googlemock) at configure time
set(GOOGLETEST_ROOT ${CMAKE_CURRENT_LIST_DIR}/external/googletest)
# Note: Once googletest is downloaded once, it won't be updated or
# downloaded again unless you delete the "external/googletest"
# directory.
if (NOT EXISTS ${GOOGLETEST_ROOT}/src/googletest/src/gtest-all.cc)
configure_file(googletest.cmake
${CMAKE_CURRENT_LIST_DIR}/external/googletest/CMakeLists.txt COPYONLY)
execute_process(COMMAND ${CMAKE_COMMAND} .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/external/googletest )
if(result)
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/external/googletest )
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()
endif()

if(ANDROID)
# Build an Android application.

# Source files used for the Android build.
set(FIREBASE_APP_FRAMEWORK_ANDROID_SRCS
src/android/android_app_framework.cc
)

# Source files used for the Android build.
set(FIREBASE_TEST_FRAMEWORK_ANDROID_SRCS
src/android/android_firebase_test_framework.cc
)

# Build native_app_glue as a static lib
add_library(native_app_glue STATIC
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)

# Export ANativeActivity_onCreate(),
# Refer to: https://github.com/android-ndk/ndk/issues/381.
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")

add_library(gtest STATIC
${GOOGLETEST_ROOT}/src/googletest/src/gtest-all.cc)
target_include_directories(gtest
PRIVATE ${GOOGLETEST_ROOT}/src/googletest
PUBLIC ${GOOGLETEST_ROOT}/src/googletest/include)
add_library(gmock STATIC
${GOOGLETEST_ROOT}/src/googlemock/src/gmock-all.cc)
target_include_directories(gmock
PRIVATE ${GOOGLETEST_ROOT}/src/googletest
PRIVATE ${GOOGLETEST_ROOT}/src/googlemock
PUBLIC ${GOOGLETEST_ROOT}/src/googletest/include
PUBLIC ${GOOGLETEST_ROOT}/src/googlemock/include)

# Define the target as a shared library, as that is what gradle expects.
set(integration_test_target_name "android_integration_test_main")
add_library(${integration_test_target_name} SHARED
${FIREBASE_APP_FRAMEWORK_SRCS}
${FIREBASE_APP_FRAMEWORK_ANDROID_SRCS}
${FIREBASE_INTEGRATION_TEST_SRCS}
${FIREBASE_TEST_FRAMEWORK_SRCS}
${FIREBASE_TEST_FRAMEWORK_ANDROID_SRCS}
)

target_include_directories(${integration_test_target_name} PRIVATE
${ANDROID_NDK}/sources/android/native_app_glue)

set(ADDITIONAL_LIBS log android atomic native_app_glue)
else()
# Build a desktop application.
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)

# Prevent overriding the parent project's compiler/linker
# settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

# Add googletest directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/external/googletest/src
${CMAKE_CURRENT_LIST_DIR}/external/googletest/build
EXCLUDE_FROM_ALL)

# The gtest/gtest_main targets carry header search path
# dependencies automatically when using CMake 2.8.11 or
# later. Otherwise we have to add them here ourselves.
if (CMAKE_VERSION VERSION_LESS 2.8.11)
include_directories("${gtest_SOURCE_DIR}/include")
include_directories("${gmock_SOURCE_DIR}/include")
endif()

# Windows runtime mode, either MD or MT depending on whether you are using
# /MD or /MT. For more information see:
# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
set(MSVC_RUNTIME_MODE MD)

# Platform abstraction layer for the desktop integration test.
set(FIREBASE_APP_FRAMEWORK_DESKTOP_SRCS
src/desktop/desktop_app_framework.cc
)

set(integration_test_target_name "integration_test")
add_executable(${integration_test_target_name}
${FIREBASE_APP_FRAMEWORK_SRCS}
${FIREBASE_APP_FRAMEWORK_DESKTOP_SRCS}
${FIREBASE_TEST_FRAMEWORK_SRCS}
${FIREBASE_INTEGRATION_TEST_SRCS}
)

if(APPLE)
set(ADDITIONAL_LIBS
gssapi_krb5
pthread
"-framework CoreFoundation"
"-framework Foundation"
"-framework GSS"
"-framework Security"
)
elseif(MSVC)
set(ADDITIONAL_LIBS advapi32 ws2_32 crypt32)
else()
set(ADDITIONAL_LIBS pthread)
endif()

# If a config file is present, copy it into the binary location so that it's
# possible to create the default Firebase app.
set(FOUND_JSON_FILE FALSE)
foreach(config "google-services-desktop.json" "google-services.json")
if (EXISTS ${config})
add_custom_command(
TARGET ${integration_test_target_name} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${config} $<TARGET_FILE_DIR:${integration_test_target_name}>)
set(FOUND_JSON_FILE TRUE)
break()
endif()
endforeach()
if(NOT FOUND_JSON_FILE)
message(WARNING "Failed to find either google-services-desktop.json or google-services.json. See the readme.md for more information.")
endif()
endif()

# Add the Firebase libraries to the target using the function from the SDK.
add_subdirectory(${FIREBASE_CPP_SDK_DIR} bin/ EXCLUDE_FROM_ALL)
# Note that firebase_app needs to be last in the list.
set(firebase_libs firebase_admob firebase_app)
set(gtest_libs gtest gmock)
target_link_libraries(${integration_test_target_name} ${firebase_libs}
${gtest_libs} ${ADDITIONAL_LIBS})
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"subtype" : "retina4",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading