Skip to content

Commit af7898c

Browse files
authored
Merge remote_test_util and remote_testing libraries (#5254)
These two libraries duplicate each other in purpose: * firebase_firestore_remote_test_util * firebase_firestore_remote_testing Additionally, several of the testing utilities in remote_test_util are really only applicable to tests in the remote library anyway. These have been put directly into firebase_firestore_remote_test.
1 parent 4616542 commit af7898c

17 files changed

+123
-184
lines changed

Firestore/Example/Firestore.xcodeproj/project.pbxproj

Lines changed: 48 additions & 48 deletions
Large diffs are not rendered by default.

Firestore/Example/Tests/SpecTests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if(APPLE)
2929
FirebaseFirestore
3030
firebase_firestore_local_testing
3131
firebase_firestore_objc_test_util
32-
firebase_firestore_remote_test_util
32+
firebase_firestore_remote_testing
3333
# Force this to run in the project-wide binary directory so that relative
3434
# paths used during compilation are usable.
3535
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}

Firestore/Example/Tests/SpecTests/FSTMockDatastore.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "Firestore/core/src/firebase/firestore/util/async_queue.h"
3636
#include "Firestore/core/src/firebase/firestore/util/log.h"
3737
#include "Firestore/core/src/firebase/firestore/util/string_apple.h"
38-
#include "Firestore/core/test/firebase/firestore/util/create_noop_connectivity_monitor.h"
38+
#include "Firestore/core/test/firebase/firestore/remote/create_noop_connectivity_monitor.h"
3939
#include "absl/memory/memory.h"
4040
#include "grpcpp/completion_queue.h"
4141

@@ -51,13 +51,13 @@
5151
using firebase::firestore::model::SnapshotVersion;
5252
using firebase::firestore::model::TargetId;
5353
using firebase::firestore::remote::ConnectivityMonitor;
54+
using firebase::firestore::remote::CreateNoOpConnectivityMonitor;
5455
using firebase::firestore::remote::GrpcConnection;
5556
using firebase::firestore::remote::WatchChange;
5657
using firebase::firestore::remote::WatchStream;
5758
using firebase::firestore::remote::WatchTargetChange;
5859
using firebase::firestore::remote::WriteStream;
5960
using firebase::firestore::util::AsyncQueue;
60-
using firebase::firestore::util::CreateNoOpConnectivityMonitor;
6161
using firebase::firestore::util::Status;
6262

6363
namespace firebase {

Firestore/core/test/firebase/firestore/remote/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
firebase_ios_cc_library(
1616
firebase_firestore_remote_testing
1717
SOURCES
18+
create_noop_connectivity_monitor.cc
19+
create_noop_connectivity_monitor.h
1820
fake_target_metadata_provider.cc
1921
fake_target_metadata_provider.h
2022
DEPENDS
23+
absl_memory
2124
firebase_firestore_remote
2225
)
2326

@@ -26,8 +29,12 @@ firebase_ios_cc_test(
2629
SOURCES
2730
datastore_test.cc
2831
exponential_backoff_test.cc
32+
fake_credentials_provider.cc
33+
fake_credentials_provider.h
2934
grpc_connection_test.cc
3035
grpc_stream_test.cc
36+
grpc_stream_tester.cc
37+
grpc_stream_tester.h
3138
grpc_streaming_reader_test.cc
3239
grpc_unary_call_test.cc
3340
remote_event_test.cc
@@ -42,7 +49,6 @@ firebase_ios_cc_test(
4249
firebase_firestore_local
4350
firebase_firestore_remote
4451
firebase_firestore_remote_testing
45-
firebase_firestore_remote_test_util
4652
firebase_firestore_testutil
4753
firebase_firestore_util_async_std
4854
GMock::GMock

Firestore/core/test/firebase/firestore/util/create_noop_connectivity_monitor.cc renamed to Firestore/core/test/firebase/firestore/remote/create_noop_connectivity_monitor.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 Google
2+
* Copyright 2018 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,19 +14,19 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "Firestore/core/test/firebase/firestore/util/create_noop_connectivity_monitor.h"
17+
#include "Firestore/core/test/firebase/firestore/remote/create_noop_connectivity_monitor.h"
1818

1919
#include "absl/memory/memory.h"
2020

2121
namespace firebase {
2222
namespace firestore {
23-
namespace util {
23+
namespace remote {
2424

25-
std::unique_ptr<remote::ConnectivityMonitor> CreateNoOpConnectivityMonitor() {
25+
std::unique_ptr<ConnectivityMonitor> CreateNoOpConnectivityMonitor() {
2626
// The default implementation does nothing
27-
return absl::make_unique<remote::ConnectivityMonitor>(nullptr);
27+
return absl::make_unique<ConnectivityMonitor>(nullptr);
2828
}
2929

30-
} // namespace util
30+
} // namespace remote
3131
} // namespace firestore
3232
} // namespace firebase
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 Google
2+
* Copyright 2018 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,21 +14,21 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifndef FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_UTIL_CREATE_NOOP_CONNECTIVITY_MONITOR_H_
18-
#define FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_UTIL_CREATE_NOOP_CONNECTIVITY_MONITOR_H_
17+
#ifndef FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_REMOTE_CREATE_NOOP_CONNECTIVITY_MONITOR_H_
18+
#define FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_REMOTE_CREATE_NOOP_CONNECTIVITY_MONITOR_H_
1919

2020
#include <memory>
2121

2222
#include "Firestore/core/src/firebase/firestore/remote/connectivity_monitor.h"
2323

2424
namespace firebase {
2525
namespace firestore {
26-
namespace util {
26+
namespace remote {
2727

28-
std::unique_ptr<remote::ConnectivityMonitor> CreateNoOpConnectivityMonitor();
28+
std::unique_ptr<ConnectivityMonitor> CreateNoOpConnectivityMonitor();
2929

30-
} // namespace util
30+
} // namespace remote
3131
} // namespace firestore
3232
} // namespace firebase
3333

34-
#endif // FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_UTIL_CREATE_NOOP_CONNECTIVITY_MONITOR_H_
34+
#endif // FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_REMOTE_CREATE_NOOP_CONNECTIVITY_MONITOR_H_

Firestore/core/test/firebase/firestore/remote/datastore_test.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
#include "Firestore/core/src/firebase/firestore/util/status.h"
3333
#include "Firestore/core/src/firebase/firestore/util/statusor.h"
3434
#include "Firestore/core/src/firebase/firestore/util/string_apple.h"
35+
#include "Firestore/core/test/firebase/firestore/remote/fake_credentials_provider.h"
36+
#include "Firestore/core/test/firebase/firestore/remote/grpc_stream_tester.h"
3537
#include "Firestore/core/test/firebase/firestore/testutil/async_testing.h"
3638
#include "Firestore/core/test/firebase/firestore/testutil/testutil.h"
37-
#include "Firestore/core/test/firebase/firestore/util/fake_credentials_provider.h"
38-
#include "Firestore/core/test/firebase/firestore/util/grpc_stream_tester.h"
3939
#include "absl/memory/memory.h"
4040
#include "absl/strings/str_cat.h"
4141
#include "gmock/gmock.h"
@@ -57,12 +57,7 @@ using nanopb::Message;
5757
using testing::Not;
5858
using testutil::Value;
5959
using util::AsyncQueue;
60-
using util::CompletionEndState;
61-
using util::CompletionResult;
6260
using util::Executor;
63-
using util::FakeCredentialsProvider;
64-
using util::FakeGrpcQueue;
65-
using util::GrpcStreamTester;
6661
using util::Status;
6762
using util::StatusOr;
6863

Firestore/core/test/firebase/firestore/util/fake_credentials_provider.cc renamed to Firestore/core/test/firebase/firestore/remote/fake_credentials_provider.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 Google
2+
* Copyright 2018 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "Firestore/core/test/firebase/firestore/util/fake_credentials_provider.h"
17+
#include "Firestore/core/test/firebase/firestore/remote/fake_credentials_provider.h"
1818

1919
#include <utility>
2020

@@ -24,7 +24,7 @@
2424

2525
namespace firebase {
2626
namespace firestore {
27-
namespace util {
27+
namespace remote {
2828

2929
using auth::EmptyCredentialsProvider;
3030
using auth::TokenListener;
@@ -65,6 +65,6 @@ void FakeCredentialsProvider::FailGetToken() {
6565
fail_get_token_ = true;
6666
}
6767

68-
} // namespace util
68+
} // namespace remote
6969
} // namespace firestore
7070
} // namespace firebase

Firestore/core/test/firebase/firestore/util/fake_credentials_provider.h renamed to Firestore/core/test/firebase/firestore/remote/fake_credentials_provider.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018 Google
2+
* Copyright 2018 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifndef FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_UTIL_FAKE_CREDENTIALS_PROVIDER_H_
18-
#define FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_UTIL_FAKE_CREDENTIALS_PROVIDER_H_
17+
#ifndef FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_REMOTE_FAKE_CREDENTIALS_PROVIDER_H_
18+
#define FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_REMOTE_FAKE_CREDENTIALS_PROVIDER_H_
1919

2020
#include <string>
2121
#include <vector>
@@ -24,7 +24,7 @@
2424

2525
namespace firebase {
2626
namespace firestore {
27-
namespace util {
27+
namespace remote {
2828

2929
class FakeCredentialsProvider : public auth::EmptyCredentialsProvider {
3030
public:
@@ -50,8 +50,8 @@ class FakeCredentialsProvider : public auth::EmptyCredentialsProvider {
5050
auth::TokenListener delayed_token_listener_;
5151
};
5252

53-
} // namespace util
53+
} // namespace remote
5454
} // namespace firestore
5555
} // namespace firebase
5656

57-
#endif // FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_UTIL_FAKE_CREDENTIALS_PROVIDER_H_
57+
#endif // FIRESTORE_CORE_TEST_FIREBASE_FIRESTORE_REMOTE_FAKE_CREDENTIALS_PROVIDER_H_

Firestore/core/test/firebase/firestore/remote/grpc_connection_test.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include "Firestore/core/src/firebase/firestore/util/async_queue.h"
2727
#include "Firestore/core/src/firebase/firestore/util/status.h"
2828
#include "Firestore/core/src/firebase/firestore/util/statusor.h"
29+
#include "Firestore/core/test/firebase/firestore/remote/grpc_stream_tester.h"
2930
#include "Firestore/core/test/firebase/firestore/testutil/async_testing.h"
30-
#include "Firestore/core/test/firebase/firestore/util/grpc_stream_tester.h"
3131
#include "absl/memory/memory.h"
3232
#include "gtest/gtest.h"
3333

@@ -39,7 +39,6 @@ using auth::Token;
3939
using auth::User;
4040
using core::DatabaseInfo;
4141
using util::AsyncQueue;
42-
using util::GrpcStreamTester;
4342
using util::Status;
4443
using util::StatusOr;
4544

0 commit comments

Comments
 (0)