| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library unittest.runner.browser.browser_manager; | 5 library unittest.runner.browser.browser_manager; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:http_parser/http_parser.dart'; | 10 import 'package:http_parser/http_parser.dart'; |
| 11 | 11 |
| 12 import '../../backend/metadata.dart'; |
| 12 import '../../backend/suite.dart'; | 13 import '../../backend/suite.dart'; |
| 13 import '../../util/multi_channel.dart'; | 14 import '../../util/multi_channel.dart'; |
| 14 import '../../util/remote_exception.dart'; | 15 import '../../util/remote_exception.dart'; |
| 15 import '../../utils.dart'; | 16 import '../../utils.dart'; |
| 16 import '../load_exception.dart'; | 17 import '../load_exception.dart'; |
| 17 import 'iframe_test.dart'; | 18 import 'iframe_test.dart'; |
| 18 | 19 |
| 19 /// A class that manages the connection to a single running browser. | 20 /// A class that manages the connection to a single running browser. |
| 20 /// | 21 /// |
| 21 /// This is in charge of telling the browser which test suites to load and | 22 /// This is in charge of telling the browser which test suites to load and |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 if (response["type"] == "loadException") { | 54 if (response["type"] == "loadException") { |
| 54 return new Future.error(new LoadException(path, response["message"])); | 55 return new Future.error(new LoadException(path, response["message"])); |
| 55 } else if (response["type"] == "error") { | 56 } else if (response["type"] == "error") { |
| 56 var asyncError = RemoteException.deserialize(response["error"]); | 57 var asyncError = RemoteException.deserialize(response["error"]); |
| 57 return new Future.error( | 58 return new Future.error( |
| 58 new LoadException(path, asyncError.error), | 59 new LoadException(path, asyncError.error), |
| 59 asyncError.stackTrace); | 60 asyncError.stackTrace); |
| 60 } | 61 } |
| 61 | 62 |
| 62 return new Suite(response["tests"].map((test) { | 63 return new Suite(response["tests"].map((test) { |
| 64 var metadata = new Metadata.deserialize(test['metadata']); |
| 63 var testChannel = suiteChannel.virtualChannel(test['channel']); | 65 var testChannel = suiteChannel.virtualChannel(test['channel']); |
| 64 return new IframeTest(test['name'], testChannel); | 66 return new IframeTest(test['name'], metadata, testChannel); |
| 65 }), path: path, platform: "Chrome"); | 67 }), path: path, platform: "Chrome"); |
| 66 }); | 68 }); |
| 67 } | 69 } |
| 68 } | 70 } |
| OLD | NEW |