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

Unified Diff: runtime/observatory/tests/service/auth_token1_test.dart

Issue 2500543002: Add following tests : (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | runtime/observatory/tests/service/auth_token_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/auth_token1_test.dart
diff --git a/runtime/observatory/tests/service/auth_token_test.dart b/runtime/observatory/tests/service/auth_token1_test.dart
similarity index 65%
copy from runtime/observatory/tests/service/auth_token_test.dart
copy to runtime/observatory/tests/service/auth_token1_test.dart
index ce75e4f298b595e9a589d3ce7639093771d29205..5afb26341328eb95be67127e867ed9dc7500474e 100644
--- a/runtime/observatory/tests/service/auth_token_test.dart
+++ b/runtime/observatory/tests/service/auth_token1_test.dart
@@ -1,10 +1,11 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2016, 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.
// VMOptions=--error_on_bad_type --error_on_bad_override
import 'dart:async';
import 'dart:developer';
+import 'dart:io' as io;
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
import 'test_helper.dart';
@@ -15,10 +16,19 @@ Future<Null> testeeBefore() async {
// Start the web server.
ServiceProtocolInfo info = await Service.controlWebServer(enable: true);
expect(info.serverUri, isNotNull);
- // Ensure that we have the auth token in the path segments.
- expect(info.serverUri.pathSegments.length, greaterThan(1));
- // Sanity check the length of the auth token.
- expect(info.serverUri.pathSegments[0].length, greaterThan(8));
+ // Ensure that we have no auth token in the path segments.
+ expect(info.serverUri.pathSegments.length, equals(0));
+
+ // Try connecting to the server without the auth token, it should succeed.
+ var port = info.serverUri.port;
+ var url = Uri.parse('http://127.0.0.1:$port');
+ var httpClient = new io.HttpClient();
+ try {
+ var request = await httpClient.getUrl(url);
+ expect(true, true);
+ } catch (e) {
+ expect(true, false);
+ }
}
var tests = [
@@ -36,4 +46,4 @@ main(args) => runIsolateTests(args,
// the testee is responsible for starting the
// web server.
testeeControlsServer: true,
- useAuthToken: true);
+ useAuthToken: false);
« no previous file with comments | « no previous file | runtime/observatory/tests/service/auth_token_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698