Skip to content

Commit df43302

Browse files
authored
merge master + namespace fixup (#2117)
* Allow for custom domains in the FDL iOS SDK Allow for custo domains to be whitelisted by the info.plist file. * Fix style. Run ./scripts/style.sh * style * Update versions for Release 5.11.0 * Update Firestore Generated Protos (#1972) * Remove cruft from project file (#1975) * Lock reads and writes to session map * Changed FDL to use compatible __typeof__() operator. (#1982) typeof() is not supported in some C language dialects which causes issues when integrating FDL in projects that do use non-GNU compiler modes. For example, this causes problems when building in some versions of Unity firebase/quickstart-unity#228 * Changed FDL to use compatible __typeof__() operator. (#1982) typeof() is not supported in some C language dialects which causes issues when integrating FDL in projects that do use non-GNU compiler modes. For example, this causes problems when building in some versions of Unity firebase/quickstart-unity#228 * Bump DynamicLinks patch version * Add FDL to release manifest * Bump GoogleUtilities patch version to deliver fix for #1964 (#1987) * Wrap diagnostics notification in collection flag check. (#1979) * Wrap diagnostics notification in collection flag check. Some of the diagnostics notifications were missed and not covered by the data collection flag. * Remove redundant notification call, move Core diagnostics API call. * Removed configure with no options test. * Queue Storage Tasks on separate queue (#1981) * Increase timeout for testDispatchAfterDelay (#1988) * Update Storage Changelog (#1989) * Add missing FirebaseStorage release note (#1990) * Allow semicolon in file name (#1991) * Remove unnecessary notification flag (#1993) * Remove unnecessary notification flag. This was added when the Google pod could configure Firebase but the Google pod is deprecated and can only work with Firebase 3.X. These flags and conditional checks can be safely removed. * Resolve issues from commit split. * Style fixes. * Reduce singleton usage in FIRApp tests. (#1995) * Reduce singleton usage in FIRApp tests. There have been some issues while creating new tests of conflicts with mocks of classes and instances, this should alleviate some of those conflicts in the future. * Remove bad style changes. * Use default app name flag instead of local variable. * Comply with c99 standard (#1992) * Trigger travis for Firestore podspec changes * Use C99-compatible __typeof__ instead of typeof (#1985) `typeof` is only defined if you compile with GNU extensions, while `__typeof__` is always available. This is the Firestore equivalent of #1982. Note that Firestore won't yet build in this mode because among other things the Objective-C gRPC still uses `typeof`. Once we eliminate that dependency this might become possible. * Adding AppCode Diff (#1996) * Remove warning (#1999) * Add InAppMessaging to Carthage template (#2006) * Restore SafariServices framework (#2002) * SafariServices not available on tvOS and not used on osx * Force Firestore to conform to C99 and C++11. (#2001) Note that c++0x is how Xcode spells c++11. Also fix an issue where we were accidentally using a C++14 feature. * Changing the internal testing repo (#2003) * Clean up test. The issue has already been fixed and we are now running integration test with actual server instead of hexa. (#2007) * gRPC: replace Objective-C implementation with the new C++ implementation (#1968) * add support for SSL disabled to `GrpcConnection` (unfortunately, there currently is no way to verify this change actually works); * make gRPC calls using the C++ implementation: * make `FSTRemoteStore` create C++ streams instead of their Objective-C counterparts; * port firebase/firebase-js-sdk#1041: streams are now never recreated, only restarted; * make `FSTDatastore` delegate server calls to the C++ implementation; * port `MockWatchStream` and `MockWriteStream` to C++ (`FSTMockDatastore` is still in place, because `Datastore` is not fully ported yet); * no longer generate Objective-C gRPC service definitions from protos; * remove all references to Objective-C gRPC client; * check in gRPC root certificates file and load it at runtime (the check-in part is temporary until gRPC-C++.podspec provides the certificate). This makes SSL work. * Add component system documentation. * Fixed markdown layout issue. * Remove trailing whitespaces. * Add table of contents. * Remove extra parentheses from TOC. * Renamed SDKs to frameworks and products for accuracy. * Updated the Carthage installation instructions (#2012) * Add Rome instructions (#2014) * Attempt to fix frequent Auth Unit Test flake on OSX (#2017) * Increase timeouts in attempt to eliminate travis flakes (#2016) * Don't rely on test always being in foreground (#2021) * Fix log overflow in continuous fuzz testing (#2020) Prevent generating too many "Unrecognized selector" console messages that eventually make Travis kill the job due to log exceeding limits. * Assign the default app before posting notifications. (#2024) Although SDKs being configured should access the app through the dictionary being passed in (and soon the `FIRCoreConfigurable` protocol), the default app should be assigned before notifying SDKs that Core is ready. * Update CHANGELOG for Firestore v0.14.0 (#2025) * M37 Core release notes (#2027) * Add changelog to GoogleUtilities * Fix static analysis warning in Core. (#2034) Explicitly check for `nil` instead of using the `!` operator on the pointer. * Update CHANGELOG.md for #2034 (#2035) * Revert "gRPC: replace Objective-C implementation with the new C++ implementation (#1968)" (#2030) This reverts commit a514bd9. * Partially revert "Update CHANGELOG for Firestore v0.14.0 (#2025)" (#2031) This removes the changelog entry that describes our migration to gRPC-C++. * Move #2034 into 5.12.0 (#2036) * Remove Held Write Acks (#2029) * Drop acknowledged mutations in schema migration (#1818) Drop acknowledged mutations in schema migration as part of removing held write acks. Port of firebase/firebase-js-sdk#1149 * Change removeMutationBatch to remove a single batch (#1955) * Update Firestore Generated Protos * Adding UnknownDocument and hasCommittedMutations (#1971) * Removing held write batch handling from LocalStore (#1997) * View changes for held write acks (#2004) * Held Write Acks Unit Test Fixes (#2008) * Held Write Ack Removal Spec Tests (#2018) * Fix integration test * Held Write Acks Changelog (#2037) To be submitted when main PR goes in * Fix tablet layout for in-app messaging (#2032) * Rename fine-tuning methods to reflect size class rather than orientation * Modify existing constraints to de-portrait tablet layout, need a card width for tablet now * Further constraint tinkering, add identifiers for better auto layout debugging * More constraints for "landscape" appearance in tablet. Looks good for every case except Thin Image, which blows up the height of the message card * Fix fine tune layout methods to correctly fine tune for compact height and width * Update layout constraint identifiers to match titles in document outline for easier debugging * Revert superfluous method name changes for layout fine tuning methods * Address travis timeout flakes (#2033) * Delete deprecated files (#2038) * Add missing nanopb flag (#2042) * Fix auth multi app support (#2043) * Isolate Firestore nanopb messages in C++ namespaces (#2046) * Add C++ namespaces and use C++ linkage for nanopb-generated sources. * Regenerate nanopb sources as C++ * Add generated C++ nanopb sources to the podspec * Fix analyze errors (#2047) * Release 5.12.0 (#2051) * Update versions for Release 5.12.0 * Add missing nanopb flag * Isolate Firestore nanopb messages in C++ namespaces (#2046) * Add C++ namespaces and use C++ linkage for nanopb-generated sources. * Regenerate nanopb sources as C++ * Add generated C++ nanopb sources to the podspec * Remove Mutation tombstones (#2052) * Remove Mutation tombstones * Review comments * Porting Multi-Tab Structural Changes (#2049) * Delete Firestore public C++ API (#2050) * Add firebase_cpp_sdk 5.4.0 ... to the Firestore CMake build. * Move C++ public API headers to cpp/include * Add Firebase C++ API tests. * Add support for building on Linux * Add clang-format configuration for Firestore/cpp * Add windows build support * Review feedback * Revert build changes to support Firebase C++ integration. It turns out the public Firebase C++ SDK doesn't include enough to actually build another component of that SDK externally so these changes don't really help. Eventually, once Firebase C++ is open source we'll integrate with that to actually test Firestore's public C++ API. * Delete Firestore/cpp and public C++ artifacts It's not yet feasible to build these components externally so there's no use in keeping them here. * Add clang-format installation instructions (#2057) * Update Auth samples to sync with internal changes (#2056) * Add a nanopb string (#1839) * Add Equatable and Comparable * Add nanopb String * FIRApp is already configured. Remove duplicate configure call. This Fixes unit test failure. * Invalidate non-background url sessions * Run style * Update abseil to master@{2018-11-06} (#2058) * Update abseil-cpp to a new upstream Update to 7990fd459e9339467814ddb95000c87cb1e4d945 master@{2018-11-06} * Re-apply -Wcomma fix * Update add_subdirectory for Abseil * Remove references to Firestore/Port (which longer exists) * Fix ABSL_HAVE_THREAD_LOCAL when targeting iOS 8 in Xcode 10 * Clean up abseil warnings * Clean up a Firestore format string warning. * Exclude third_party/abseil-cpp from whitespace checks * Port code review changes from google3 * Amend changelog * Minor edits: change domain names in test app plist, fix warnings. * Fix warning. * Fix style. * Adding Numeric Add Proto message (#2064) * Adding Numeric Add Proto message * Remove trailing whitespace * Adding base_writes proto field (#2066) * Update the GULObjectSwizzler to handle NSProxy objects (#2053) * GoogleUtilities 5.3.5 (#2067) * gRPC: replace Objective-C implementation with the new C++ implementation (#2068) * Revert "Revert "gRPC: replace Objective-C implementation with the new C++ implementation (#1968)" (#2030)" This reverts commit ea567dc. * gRPC: fix bugs found during testing (#2039) All in `GrpcStream`: * make sure there are no pending completions when "finish" operation is enqueued; * always finish gRPC calls; * when connectivity changes, reset not just the calls, but the underlying channel as well. * Revert "Partially revert "Update CHANGELOG for Firestore v0.14.0 (#2025)" (#2031)" This reverts commit b2437b8. * Update changelog for v0.15.0. * gRPC: add gRPC wrapper classes to CMake build (#2015) * add a C++ equivalent of `FIRFirestoreVersionString`. This eliminates the only Objective-C dependency of `grpc_connection.mm` and allows making it a pure C++ file; * open-source `binary_to_array.py` script and use it in the build to embed `roots.pem` certificate file from gRPC into the Firestore binary. The embedded char array is then used to load certificate at runtime. * Revert local change -- do not enable sanitizers by default * Fix `string_view` referring to an out-of-scope string (#2074) * Allow setting the domainURIPrefix for custom domain names/paths when creating dynamic links (#2071) * Add support for creating DL with custom domain names/paths. The new domainURIPrefix parameter requires either a. a valid FDL domain name created in the Firebase console or b. a custom domain name or c. a custom domain name with path registered for DL. All domainURIPrefixes need to start with a valid (https) scheme. * Fix style. * style * Fix typo in DEPRECATED_MSG_ATTRIBUTE, other nits. * Fix styling. * Check incoming domainURIPrefix for validity using NSURL and check for an https scheme. * Release manifest for 5.13.0 (#2076) * Renaming manifest (#2077) * Release manifest for 5.13.0 * Add warning for deprecated API to indicate that the passed in domain name's scheme will deduced as https (#2078) * Add support for creating DL with custom domain names/paths. The new domainURIPrefix parameter requires either a. a valid FDL domain name created in the Firebase console or b. a custom domain name or c. a custom domain name with path registered for DL. All domainURIPrefixes need to start with a valid (https) scheme. * Fix style. * style * Fix typo in DEPRECATED_MSG_ATTRIBUTE, other nits. * Fix styling. * Check incoming domainURIPrefix for validity using NSURL and check for an https scheme. * Add extra checks for deprecated domain parameter being incorrectly called with a scheme. Also fix some nits. * Log a warning for the deprecated API stating that the scheme for the supplied domain will be deduced as https. * Update CHANGELOG for M38. * Update changelog for M38 * Update CHANGELOG for M38 release. * Capitalize HTTPS. * Update CHANGELOG to include PR for removal of deprecated files. * Capitalize HTTPS. * Fix GoogleUtilities nullability regressions (#2079) * Remove `adjustsFontForContentSizeCategory` (unsupported in iOS 10.0) from labels in card layout Storyboard (#2083) * Add pod spec lint testing for Xcode 9 (#2084) * FirebaseAnalyticsInterop is cross-platform (#2088) * C++: eliminate `FSTDispatchQueue` and replace it with `AsyncQueue` (#2062) * replace all references to `FSTDispatchQueue` and `FSTTimerID` with their C++ equivalents; * remove `FSTDispatchQueue` class and related tests; * in method argument names, replace `workerDispatchQueue` with just `workerQueue`, more similar to other platforms; * move `Executor` and derived classes out of `internal` namespace. * Database Interop (#1865) * Register Database with Interop + Add AuthInterop dependency + Have Database register with Interop component container + Add weak dependency on Auth ~ Cleaned up imports * Use Interop for Auth token fetching + Use macro to get auth component ~ Change `getTokenForcingRefresh:withCallback:` call to use Interop component version of Auth ~ Clean up imports * Implement necessary protocols + Added FIRComponentRegistrant and FIRDatabaseNilProtocol to FIRDatabase * Squash of my previous local commits for Database Interop Register Database with Interop: + Add AuthInterop dependency + Have Database register with Interop component container + Add weak dependency on Auth ~ Cleaned up imports Use Interop for Auth token fetching: + Use macro to get auth component ~ Change `getTokenForcingRefresh:withCallback:` call to use Interop component version of Auth ~ Clean up imports Implement necessary protocols: + Added FIRComponentRegistrant and FIRDatabaseNilProtocol to FIRDatabase Clean up Database tests: - Removed all unnecessary header files ~ Ran style.sh across all the tests Cleaned Up project file: Some header removals were missed in the last commit. Sorted some test files Fix Database Fake App Tests: + Added container property + Added an Auth fake in the container + Added the Shared utils files to the necessary targets + Added a missing XCTest reference in a test that didn't compile for me * Revert "Squash of my previous local commits for Database Interop" This reverts commit c0d0421. * Cleaned Up project file Some header removals were missed in the last commit. * Sorted some test files * Fix Database Fake App Tests + Added container property + Added an Auth fake in the container + Added the Shared utils files to the necessary targets + Added a missing XCTest reference in a test that didn't compile for me * PR Feedback Changes + Created new FIRDatabaseComponent class to encapsulate instance creation + Updated FAuthTokenProvider to only use an auth instance rather than an app. * PR Feedback Follow-Up - Removed FIRDatabase registration code * pod deintegrate * Move instance management Somes tests may still be out of date. * Fix Auth integration test * pod deintegrate -- again * PR Feedback * PR Feedback Added the FIRComponentLifecycleMaintainer protocol to FIRDatabaseComponent * Update Firebase/Database/Api/FIRDatabaseComponent.m Missed some small changes * Get integration tests compiling * Fix some tests * Fixed more tests Component needs to be cacheable in order to get the appWIllBeDeleted callback. * Update target memberships * Revert project file changes * Add FIRAuthInteropFake for broken targets * PR feedback * Spacing and Style * Moved `instances` to ivar * Simplify FIRDatabaseDictionary It's now keyed on the URL with the app being implied since each app will get its own `FIRDatabaseComponent` * Revert "Database Interop (#1865)" (#2093) This reverts commit 4090195. * Revert premature api changes (#2097) * Revert "Add warning for deprecated API to indicate that the passed in domain name's scheme will deduced as https (#2078)" This reverts commit ceb8392. * Revert "Allow setting the domainURIPrefix for custom domain names/paths when creating dynamic links (#2071)" This reverts commit d917bac. * Revert "Minor edits: change domain names in test app plist, fix warnings." This reverts commit 15f5d46. * Revert "Fix style. Run ./scripts/style.sh" This reverts commit 0e16e6c. * Revert "Allow for custom domains in the FDL iOS SDK" This reverts commit 5e33153. * Version is still 3.2.0 * Add test for verify iOS client (#2096) * Release 5.13.0 (#2101) * Update versions for Release 5.13.0 * Revert premature api changes (#2097) * Revert "Add warning for deprecated API to indicate that the passed in domain name's scheme will deduced as https (#2078)" This reverts commit ceb8392. * Revert "Allow setting the domainURIPrefix for custom domain names/paths when creating dynamic links (#2071)" This reverts commit d917bac. * Revert "Minor edits: change domain names in test app plist, fix warnings." This reverts commit 15f5d46. * Revert "Fix style. Run ./scripts/style.sh" This reverts commit 0e16e6c. * Revert "Allow for custom domains in the FDL iOS SDK" This reverts commit 5e33153. * Version is still 3.2.0 * Pin gRPC-C++ version to exactly 0.0.5 (#2105) While gRPC-C++ is in its 0.* versions, any new version could potentially contain breaking changes. Make sure we only upgrade at our own pace. * Database Interop Rollforward (#2095) * Register Database with Interop + Add AuthInterop dependency + Have Database register with Interop component container + Add weak dependency on Auth ~ Cleaned up imports * Use Interop for Auth token fetching + Use macro to get auth component ~ Change `getTokenForcingRefresh:withCallback:` call to use Interop component version of Auth ~ Clean up imports * Implement necessary protocols + Added FIRComponentRegistrant and FIRDatabaseNilProtocol to FIRDatabase * Squash of my previous local commits for Database Interop Register Database with Interop: + Add AuthInterop dependency + Have Database register with Interop component container + Add weak dependency on Auth ~ Cleaned up imports Use Interop for Auth token fetching: + Use macro to get auth component ~ Change `getTokenForcingRefresh:withCallback:` call to use Interop component version of Auth ~ Clean up imports Implement necessary protocols: + Added FIRComponentRegistrant and FIRDatabaseNilProtocol to FIRDatabase Clean up Database tests: - Removed all unnecessary header files ~ Ran style.sh across all the tests Cleaned Up project file: Some header removals were missed in the last commit. Sorted some test files Fix Database Fake App Tests: + Added container property + Added an Auth fake in the container + Added the Shared utils files to the necessary targets + Added a missing XCTest reference in a test that didn't compile for me * Revert "Squash of my previous local commits for Database Interop" This reverts commit c0d0421. * Cleaned Up project file Some header removals were missed in the last commit. * Sorted some test files * Fix Database Fake App Tests + Added container property + Added an Auth fake in the container + Added the Shared utils files to the necessary targets + Added a missing XCTest reference in a test that didn't compile for me * PR Feedback Changes + Created new FIRDatabaseComponent class to encapsulate instance creation + Updated FAuthTokenProvider to only use an auth instance rather than an app. * PR Feedback Follow-Up - Removed FIRDatabase registration code * pod deintegrate * Move instance management Somes tests may still be out of date. * Fix Auth integration test * pod deintegrate -- again * PR Feedback * PR Feedback Added the FIRComponentLifecycleMaintainer protocol to FIRDatabaseComponent * Update Firebase/Database/Api/FIRDatabaseComponent.m Missed some small changes * Get integration tests compiling * Fix some tests * Fixed more tests Component needs to be cacheable in order to get the appWIllBeDeleted callback. * Update target memberships * Revert project file changes * Add FIRAuthInteropFake for broken targets * PR feedback * Spacing and Style * Moved `instances` to ivar * Simplify FIRDatabaseDictionary It's now keyed on the URL with the app being implied since each app will get its own `FIRDatabaseComponent` * Fix Database Integration Tests Have the FakeApp cache DB instances Use the Full host/URL path to cache DB instances Simplified shared scheme ``` Test Suite 'Database_IntegrationTests_iOS.xctest' passed at 2018-11-20 07:09:30.520. Executed 326 tests, with 0 failures (0 unexpected) in 66.251 (66.528) seconds Test Suite 'All tests' passed at 2018-11-20 07:09:30.522. Executed 326 tests, with 0 failures (0 unexpected) in 66.251 (66.530) seconds ``` * Clarify defaultApp use * Prefer roots.pem from gRPC-C++, but fall back to Firestore bundled ones if necessary (#2106) gRPC-C++ versions up to and including 0.0.3, and also 0.0.5, don't bundle `roots.pem` in the podspec. gRPC-C++ 0.0.4 and, presumably, the currently not-yet-released 0.0.6 do. Firestore currently also bundles this file under the same bundle name, which leads to build errors when both Firestore and gRPC-C++ try to add the file into the build (only shows during archiving). For transition, this PR: * renames the Firestore bundle to avoid naming clash; * changes the loading code so that it first tries to load certificates bundled with gRPC-C++ (versions 0.0.4 and 0.0.6+), but falls back to those bundled with Firestore if necessary. At a later point, Firestore should be changed to not bundle the certificates altogether. * Add Firebase Source to Header Search Path (#2114) This resolves the annoying Xcode errors that claim `FIRAppInternal.h` can't be found. It also makes it *much* easier to "Jump to definition" now. * Implement PatchMutation::ApplyToLocalView (#1973) * Test namespacing fixup Since the nanopb protos are now namespaced, we need to account for that in our serializer_test.cc file.
1 parent cbfcb8a commit df43302

File tree

1,293 files changed

+172969
-43799
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,293 files changed

+172969
-43799
lines changed

.travis.yml

+31
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,37 @@ jobs:
161161
script:
162162
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
163163

164+
# Xcode 9 may find lint errors that don't show up in Xcode 10 (#2081)
165+
- stage: test
166+
osx_image: xcode9.4
167+
env:
168+
- PROJECT=Firebase PLATFORM=iOS METHOD=pod-lib-lint
169+
before_install:
170+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
171+
script:
172+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleUtilities.podspec
173+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseCore.podspec
174+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAnalyticsInterop.podspec
175+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAuth.podspec
176+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAuthInterop.podspec
177+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseDatabase.podspec
178+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseDynamicLinks.podspec
179+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseMessaging.podspec
180+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseStorage.podspec
181+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFunctions.podspec
182+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessagingDisplay.podspec
183+
184+
- stage: test
185+
osx_image: xcode9.4
186+
env:
187+
- PROJECT=Firestore PLATFORM=iOS METHOD=pod-lib-lint
188+
before_install:
189+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
190+
script:
191+
# Eliminate the one warning from BoringSSL when CocoaPods 1.6.0 is available.
192+
# The travis_wait is necessary because the command takes more than 10 minutes.
193+
- travis_wait ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFirestore.podspec --allow-warnings --no-subspecs
194+
164195
# Community-supported platforms
165196

166197
- stage: test

CMakeLists.txt

+14-10
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ set(
5959
CACHE PATH "Where to store downloaded files"
6060
)
6161

62+
set(
63+
FIREBASE_EXTERNAL_SOURCE_DIR
64+
${FIREBASE_BINARY_DIR}/external/src
65+
CACHE PATH "Root directory of source code of the external dependencies"
66+
)
67+
6268
download_external_sources()
6369

6470

@@ -81,20 +87,20 @@ add_external_subdirectory(benchmark)
8187
# Abseil-cpp
8288
# Force disable Abseil's tests, which don't compile under VS2017.
8389
set(old_build_testing ${BUILD_TESTING})
84-
set(BUILD_TESTING OFF CACHE BOOL "Disable Abseil tests" FORCE)
90+
set(ABSL_RUN_TESTS OFF CACHE BOOL "Disable Abseil tests" FORCE)
8591
add_subdirectory(
8692
Firestore/third_party/abseil-cpp
93+
EXCLUDE_FROM_ALL
8794
)
88-
set(BUILD_TESTING ${old_build_testing} CACHE BOOL "Restore BUILD_TESTING" FORCE)
8995

9096

9197
# gRPC
92-
find_package(OpenSSL)
98+
find_package(OpenSSL QUIET)
9399
if(OPENSSL_FOUND)
94100
set(gRPC_SSL_PROVIDER package CACHE STRING "Use external OpenSSL")
95101
endif()
96102

97-
find_package(ZLIB)
103+
find_package(ZLIB QUIET)
98104
if(ZLIB_FOUND)
99105
set(gRPC_ZLIB_PROVIDER package CACHE STRING "Use external ZLIB")
100106
endif()
@@ -103,8 +109,6 @@ set(gRPC_BUILD_TESTS OFF CACHE BOOL "Disable gRPC tests")
103109
add_external_subdirectory(grpc)
104110

105111
# Fix up targets included by gRPC's build
106-
set(external_src_dir ${FIREBASE_BINARY_DIR}/external/src)
107-
108112
if(OPENSSL_FOUND)
109113
# gRPC's CMakeLists.txt does not account for finding OpenSSL in a directory
110114
# that's not in the default search path.
@@ -127,14 +131,14 @@ else()
127131
target_include_directories(
128132
crypto
129133
INTERFACE
130-
$<BUILD_INTERFACE:${external_src_dir}/grpc/third_party/boringssl/include>
134+
$<BUILD_INTERFACE:${FIREBASE_EXTERNAL_SOURCE_DIR}/grpc/third_party/boringssl/include>
131135
)
132136

133137
add_alias(OpenSSL::SSL ssl)
134138
target_include_directories(
135139
ssl
136140
INTERFACE
137-
$<BUILD_INTERFACE:${external_src_dir}/grpc/third_party/boringssl/include>
141+
$<BUILD_INTERFACE:${FIREBASE_EXTERNAL_SOURCE_DIR}/grpc/third_party/boringssl/include>
138142
)
139143
endif()
140144

@@ -156,7 +160,7 @@ endif()
156160
if(NOT ZLIB_FOUND)
157161
target_include_directories(
158162
zlibstatic
159-
INTERFACE $<BUILD_INTERFACE:${external_src_dir}/grpc/third_party/zlib>
163+
INTERFACE $<BUILD_INTERFACE:${FIREBASE_EXTERNAL_SOURCE_DIR}/grpc/third_party/zlib>
160164
)
161165
endif()
162166

@@ -186,7 +190,7 @@ target_compile_definitions(
186190

187191
target_include_directories(
188192
protobuf-nanopb
189-
INTERFACE $<BUILD_INTERFACE:${external_src_dir}/nanopb>
193+
INTERFACE $<BUILD_INTERFACE:${FIREBASE_EXTERNAL_SOURCE_DIR}/nanopb>
190194
)
191195

192196

Example/Auth/ApiTests/FirebaseAuthApiTests.m

+1-6
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
#ifdef NO_NETWORK
2525
#import "ITUIOSTestUtil.h"
26-
#import "ioReplayer/IORManager.h"
27-
#import "ioReplayer/IORTestCase.h"
2826
#endif
2927

3028
#import <GTMSessionFetcher/GTMSessionFetcher.h>
@@ -93,11 +91,8 @@
9391
#define SKIP_IF_ON_MOBILE_HARNESS
9492
#endif
9593

96-
#ifdef NO_NETWORK
97-
@interface ApiTests : IORTestCase
98-
#else
9994
@interface ApiTests : XCTestCase
100-
#endif
95+
10196
@end
10297

10398
@implementation ApiTests
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Copyright 2018 Google
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#import <XCTest/XCTest.h>
18+
#import <EarlGrey/EarlGrey.h>
19+
#import <FirebaseCore/FIRApp.h>
20+
#import "FirebaseAuth.h"
21+
22+
static CGFloat const kShortScrollDistance = 100;
23+
24+
static NSTimeInterval const kWaitForElementTimeOut = 15;
25+
26+
@interface FIRVerifyIOSClientTests : XCTestCase
27+
@end
28+
29+
/** Convenience function for EarlGrey tests. */
30+
static id<GREYMatcher> grey_scrollView(void) {
31+
return [GREYMatchers matcherForKindOfClass:[UIScrollView class]];
32+
}
33+
34+
@implementation FIRVerifyIOSClientTests
35+
36+
/** To reset the app so that each test sees the app in a clean state. */
37+
- (void)setUp {
38+
[super setUp];
39+
40+
[self signOut];
41+
42+
[[EarlGrey selectElementWithMatcher:grey_allOf(grey_scrollView(),
43+
grey_kindOfClass([UITableView class]), nil)]
44+
performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)];
45+
}
46+
47+
#pragma mark - Tests
48+
49+
/** Test verify ios client*/
50+
- (void)testVerifyIOSClient {
51+
[[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(@"Verify iOS client"),
52+
grey_sufficientlyVisible(), nil)]
53+
usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, kShortScrollDistance)
54+
onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]),
55+
nil)] performAction:grey_tap()];
56+
57+
[self waitForElementWithText:@"OK" withDelay:kWaitForElementTimeOut];
58+
59+
[[EarlGrey selectElementWithMatcher:grey_text(@"OK")] performAction:grey_tap()];
60+
}
61+
62+
#pragma mark - Helpers
63+
64+
/** Sign out current account. */
65+
- (void)signOut {
66+
NSError *signOutError;
67+
BOOL status = [[FIRAuth auth] signOut:&signOutError];
68+
69+
// Just log the error because we don't want to fail the test if signing out fails.
70+
if (!status) {
71+
NSLog(@"Error signing out: %@", signOutError);
72+
}
73+
}
74+
75+
/** Wait for an element with text to appear. */
76+
- (void)waitForElementWithText:(NSString *)text withDelay:(NSTimeInterval)maxDelay {
77+
GREYCondition *displayed =
78+
[GREYCondition conditionWithName:@"Wait for element"
79+
block:^BOOL {
80+
NSError *error = nil;
81+
[[EarlGrey selectElementWithMatcher:grey_text(text)]
82+
assertWithMatcher:grey_sufficientlyVisible()
83+
error:&error];
84+
return !error;
85+
}];
86+
GREYAssertTrue([displayed waitWithTimeout:maxDelay], @"Failed to wait for element '%@'.", text);
87+
}
88+
89+
@end

Example/Auth/EarlGreyTests/FirebaseAuthEarlGreyTests.m

+4-12
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
#import <FirebaseCore/FIRApp.h>
2222
#import "FirebaseAuth.h"
2323

24-
#ifdef NO_NETWORK
25-
#import "ioReplayer/IORTestCase.h"
26-
#endif
27-
2824
/** The url for obtaining a valid custom token string used to test BYOAuth. */
2925
static NSString *const kCustomTokenUrl = @"https://fb-sa-1211.appspot.com/token";
3026

@@ -38,15 +34,11 @@
3834

3935
static NSTimeInterval const kWaitForElementTimeOut = 5;
4036

41-
#ifdef NO_NETWORK
42-
@interface BasicUITest : IORTestCase
43-
#else
4437
@interface BasicUITest :XCTestCase
45-
#endif
4638
@end
4739

4840
/** Convenience function for EarlGrey tests. */
49-
id<GREYMatcher> grey_scrollView(void) {
41+
static id<GREYMatcher> grey_scrollView(void) {
5042
return [GREYMatchers matcherForKindOfClass:[UIScrollView class]];
5143
}
5244

@@ -60,7 +52,7 @@ - (void)setUp {
6052

6153
[[EarlGrey selectElementWithMatcher:grey_allOf(grey_scrollView(),
6254
grey_kindOfClass([UITableView class]), nil)]
63-
performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)];
55+
performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)];
6456
}
6557

6658
#pragma mark - Tests
@@ -156,8 +148,7 @@ - (void)testSignInWithInvalidBYOAuthToken {
156148

157149
[[EarlGrey selectElementWithMatcher:grey_text(@"Done")] performAction:grey_tap()];
158150

159-
NSString *invalidTokenErrorMessage =
160-
@"The custom token format is incorrect. Please check the documentation.";
151+
NSString *invalidTokenErrorMessage = @"Sign-In Error";
161152

162153
[self waitForElementWithText:invalidTokenErrorMessage withDelay:kWaitForElementTimeOut];
163154

@@ -190,4 +181,5 @@ - (void)waitForElementWithText:(NSString *)text withDelay:(NSTimeInterval)maxDel
190181
}];
191182
GREYAssertTrue([displayed waitWithTimeout:maxDelay], @"Failed to wait for element '%@'.", text);
192183
}
184+
193185
@end

Example/Auth/Sample/AppManager.m

-6
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222

2323
NS_ASSUME_NONNULL_BEGIN
2424

25-
// Declares a private method of FIRInstanceID to work around a bug.
26-
@interface FIRInstanceID : NSObject
27-
+ (void)notifyTokenRefresh;
28-
@end
29-
3025
@implementation AppManager {
3126
/** @var _createdAppNames
3227
@brief The set of names of live (created but not deleted) app, to avoid iCore warnings.
@@ -59,7 +54,6 @@ - (void)recreateAppAtIndex:(int)index
5954
completion:(void (^)())completion {
6055
[self deleteAppAtIndex:index completion:^() {
6156
if (index == 0) {
62-
[FIRInstanceID notifyTokenRefresh]; // b/28967043
6357
if (options) {
6458
[FIRApp configureWithOptions:options];
6559
}

0 commit comments

Comments
 (0)