Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Unified Diff: pkg/oauth2/test/utils.dart

Issue 812253002: Delete a bunch of packages that are now on GitHub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Un-delete http Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/oauth2/test/handle_access_token_response_test.dart ('k') | pkg/oauth2/test/utils_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/oauth2/test/utils.dart
diff --git a/pkg/oauth2/test/utils.dart b/pkg/oauth2/test/utils.dart
deleted file mode 100644
index fddcd372eeafa8cdfada1f522b4ccae046a57bb7..0000000000000000000000000000000000000000
--- a/pkg/oauth2/test/utils.dart
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2012, the Dart 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.
-
-library utils;
-
-import 'dart:async';
-import 'dart:collection' show Queue;
-
-import 'package:http/http.dart' as http;
-import 'package:http/testing.dart';
-import 'package:oauth2/oauth2.dart' as oauth2;
-import 'package:unittest/unittest.dart';
-
-class ExpectClient extends MockClient {
- final Queue<MockClientHandler> _handlers;
-
- ExpectClient._(MockClientHandler fn)
- : _handlers = new Queue<MockClientHandler>(),
- super(fn);
-
- factory ExpectClient() {
- var client;
- client = new ExpectClient._((request) =>
- client._handleRequest(request));
- return client;
- }
-
- void expectRequest(MockClientHandler fn) {
- var completer = new Completer();
- expect(completer.future, completes);
-
- _handlers.add((request) {
- completer.complete(null);
- return fn(request);
- });
- }
-
- Future<http.Response> _handleRequest(http.Request request) {
- if (_handlers.isEmpty) {
- return new Future.value(new http.Response('not found', 404));
- } else {
- return _handlers.removeFirst()(request);
- }
- }
-}
-
-/// A matcher for AuthorizationExceptions.
-const isAuthorizationException = const _AuthorizationException();
-
-/// A matcher for functions that throw AuthorizationException.
-const Matcher throwsAuthorizationException =
- const Throws(isAuthorizationException);
-
-class _AuthorizationException extends TypeMatcher {
- const _AuthorizationException() : super("AuthorizationException");
- bool matches(item, Map matchState) =>
- item is oauth2.AuthorizationException;
-}
-
-/// A matcher for ExpirationExceptions.
-const isExpirationException = const _ExpirationException();
-
-/// A matcher for functions that throw ExpirationException.
-const Matcher throwsExpirationException =
- const Throws(isExpirationException);
-
-class _ExpirationException extends TypeMatcher {
- const _ExpirationException() : super("ExpirationException");
- bool matches(item, Map matchState) =>
- item is oauth2.ExpirationException;
-}
« no previous file with comments | « pkg/oauth2/test/handle_access_token_response_test.dart ('k') | pkg/oauth2/test/utils_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698