This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[google_sign_in_web] Ensure plugin throws PlatformExceptions (#2943)
Instead of throwing JS objects, or attempting to access undefined properties. This change also migrates tests to the `integration_test` package.
- Loading branch information
Showing
24 changed files
with
477 additions
and
157 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Running browser_tests | ||
|
||
Make sure you have updated to the latest Flutter master. | ||
|
||
1. Check what version of Chrome is running on the machine you're running tests on. | ||
|
||
2. Download and install driver for that version from here: | ||
* <https://chromedriver.chromium.org/downloads> | ||
|
||
3. Start the driver using `chromedriver --port=4444` | ||
|
||
4. Change into the `test` directory of your clone. | ||
|
||
5. Run tests: `flutter drive -d web-server --browser-name=chrome --target=test_driver/TEST_NAME_integration.dart`, or (in Linux): | ||
|
||
* Single: `./run_test test_driver/TEST_NAME_integration.dart` | ||
* All: `./run_test` |
83 changes: 0 additions & 83 deletions
83
packages/google_sign_in/google_sign_in_web/test/auth2_test.dart
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
packages/google_sign_in/google_sign_in_web/test/gapi_mocks/src/auth2_init.dart
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
packages/google_sign_in/google_sign_in_web/test/lib/main.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,22 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:flutter/material.dart'; | ||
|
||
void main() { | ||
runApp(MyApp()); | ||
} | ||
|
||
/// App for testing | ||
class MyApp extends StatefulWidget { | ||
@override | ||
_MyAppState createState() => _MyAppState(); | ||
} | ||
|
||
class _MyAppState extends State<MyApp> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Text('Testing... Look at the console output for results!'); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/google_sign_in/google_sign_in_web/test/pubspec.yaml
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,24 @@ | ||
name: regular_integration_tests | ||
publish_to: none | ||
|
||
environment: | ||
sdk: ">=2.2.2 <3.0.0" | ||
|
||
dependencies: | ||
flutter: | ||
sdk: flutter | ||
|
||
dev_dependencies: | ||
google_sign_in: ^4.5.3 | ||
flutter_driver: | ||
sdk: flutter | ||
flutter_test: | ||
sdk: flutter | ||
http: ^0.12.2 | ||
mockito: ^4.1.1 | ||
integration_test: | ||
path: ../../../integration_test | ||
|
||
dependency_overrides: | ||
google_sign_in_web: | ||
path: ../ |
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 @@ | ||
#!/usr/bin/bash | ||
if pgrep -lf chromedriver > /dev/null; then | ||
echo "chromedriver is running." | ||
|
||
if [ $# -eq 0 ]; then | ||
echo "No target specified, running all tests..." | ||
find test_driver/ -iname *_integration.dart | xargs -n1 -i -t flutter drive -d web-server --web-port=7357 --browser-name=chrome --target='{}' | ||
else | ||
echo "Running test target: $1..." | ||
set -x | ||
flutter drive -d web-server --web-port=7357 --browser-name=chrome --target=$1 | ||
fi | ||
|
||
else | ||
echo "chromedriver is not running." | ||
fi | ||
|
Oops, something went wrong.