forked from firebase/flutterfire
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate cloud_firestore to android v2 embedding. (firebase#2269)
- Loading branch information
1 parent
3158071
commit 9c6fb46
Showing
14 changed files
with
157 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
17 changes: 17 additions & 0 deletions
17
...rc/androidTest/java/io/flutter/plugins/firebase/firestoreexample/FlutterActivityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package io.flutter.plugins.firebase.firestoreexample; | ||
|
||
import androidx.test.rule.ActivityTestRule; | ||
import dev.flutter.plugins.e2e.FlutterRunner; | ||
import io.flutter.embedding.android.FlutterActivity; | ||
import org.junit.Rule; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(FlutterRunner.class) | ||
public class FlutterActivityTest { | ||
@Rule | ||
public ActivityTestRule<FlutterActivity> rule = new ActivityTestRule<>(FlutterActivity.class); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...d/app/src/main/java/io/flutter/plugins/firebase/firestoreexample/EmbeddingV1Activity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package io.flutter.plugins.firebase.firestoreexample; | ||
|
||
import android.os.Bundle; | ||
import io.flutter.app.FlutterActivity; | ||
import io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin; | ||
import io.flutter.view.FlutterMain; | ||
|
||
public class EmbeddingV1Activity extends FlutterActivity { | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
FlutterMain.startInitialization(this); | ||
super.onCreate(savedInstanceState); | ||
CloudFirestorePlugin.registerWith(registrarFor("io.flutter.plugins.firebase.cloudfirestore")); | ||
} | ||
} |
17 changes: 0 additions & 17 deletions
17
.../android/app/src/main/java/io/flutter/plugins/firebase/firestoreexample/MainActivity.java
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...oid/app/src/main/java/io/flutter/plugins/firebasedatabaseexample/EmbeddingV1Activity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
package io.flutter.plugins.firebase.firebasedatabaseexample; | ||
|
||
import android.os.Bundle; | ||
import io.flutter.app.FlutterActivity; | ||
import io.flutter.plugins.firebase.cloudfirestore.CloudFirestorePlugin; | ||
import io.flutter.view.FlutterMain; | ||
|
||
public class EmbeddingV1Activity extends FlutterActivity { | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
FlutterMain.startInitialization(this); | ||
super.onCreate(savedInstanceState); | ||
CloudFirestorePlugin.registerWith(registrarFor("io.flutter.plugins.firebase.cloudfirestore")); | ||
} | ||
} |
17 changes: 0 additions & 17 deletions
17
...le/android/app/src/main/java/io/flutter/plugins/firebasedatabaseexample/MainActivity.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ dev_dependencies: | |
flutter_driver: | ||
sdk: flutter | ||
test: any | ||
e2e: ^0.2.1 | ||
|
||
flutter: | ||
uses-material-design: true |
12 changes: 12 additions & 0 deletions
12
packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:e2e/e2e.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
|
||
void main() { | ||
E2EWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
testWidgets('Can initialize the plugin', (WidgetTester tester) async { | ||
Firestore firestore = Firestore(); | ||
expect(firestore, isNotNull); | ||
}); | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/cloud_firestore/cloud_firestore/example/test_driver/cloud_firestore_e2e_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'dart:async'; | ||
import 'dart:io'; | ||
import 'package:flutter_driver/flutter_driver.dart'; | ||
|
||
Future<void> main() async { | ||
final FlutterDriver driver = await FlutterDriver.connect(); | ||
final String result = | ||
await driver.requestData(null, timeout: const Duration(minutes: 1)); | ||
await driver.close(); | ||
exit(result == 'pass' ? 0 : 1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters