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

Unified Diff: runtime/observatory/lib/src/app/application.dart

Issue 2972133002: Restored vm-connect Observatory_UI tests (Closed)
Patch Set: Created 3 years, 5 months 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/lib/src/elements/css/shared.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/app/application.dart
diff --git a/runtime/observatory/lib/src/app/application.dart b/runtime/observatory/lib/src/app/application.dart
index 5363fb09e49c4cf5acba8818bdd339f5055bb7d3..e6f11b627cca6409c23d8d157f6ca62bc6878718 100644
--- a/runtime/observatory/lib/src/app/application.dart
+++ b/runtime/observatory/lib/src/app/application.dart
@@ -9,7 +9,7 @@ part of app;
class ObservatoryApplication {
static ObservatoryApplication app;
final RenderingQueue queue = new RenderingQueue();
- final TargetRepository targets = new TargetRepository();
+ final TargetRepository targets = new TargetRepository(isConnectedVMTarget);
final EventRepository events = new EventRepository();
final NotificationRepository notifications = new NotificationRepository();
final _pageRegistry = new List<Page>();
@@ -20,10 +20,10 @@ class ObservatoryApplication {
VM _vm;
VM get vm => _vm;
- bool isConnectedVMTarget(WebSocketVMTarget target) {
- if (_vm is CommonWebSocketVM) {
- if ((_vm as CommonWebSocketVM).target == target) {
- return _vm.isConnected;
+ static bool isConnectedVMTarget(WebSocketVMTarget target) {
+ if (app._vm is CommonWebSocketVM) {
+ if ((app._vm as CommonWebSocketVM).target == target) {
+ return app._vm.isConnected;
}
}
return false;
@@ -235,13 +235,18 @@ class ObservatoryApplication {
}
if (targets.current == null) {
_switchVM(null);
- }
- final bool currentTarget =
- (_vm as WebSocketVM)?.target == targets.current;
- final bool currentTargetConnected = (_vm != null) && !_vm.isDisconnected;
- if (!currentTarget || !currentTargetConnected) {
- _switchVM(new WebSocketVM(targets.current));
- app.locationManager.go(Uris.vm());
+ } else {
+ final bool currentTarget =
+ (_vm as WebSocketVM)?.target == targets.current;
+ final bool currentTargetConnected = (_vm != null) && _vm.isConnected;
+ if (!currentTarget || !currentTargetConnected) {
+ _switchVM(new WebSocketVM(targets.current));
+ _vm.onConnect.then((_) {
+ app.locationManager.go(Uris.vm());
+ });
+ } else if (currentTargetConnected) {
+ app.locationManager.go(Uris.vm());
+ }
}
});
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/css/shared.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698