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

Unified Diff: runtime/bin/vmservice/client/lib/src/observatory_elements/navigation_bar_isolate.dart

Issue 143973005: Code coverage in Observatory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
Index: runtime/bin/vmservice/client/lib/src/observatory_elements/navigation_bar_isolate.dart
diff --git a/runtime/bin/vmservice/client/lib/src/observatory_elements/navigation_bar_isolate.dart b/runtime/bin/vmservice/client/lib/src/observatory_elements/navigation_bar_isolate.dart
new file mode 100644
index 0000000000000000000000000000000000000000..cbe281113c06067dcfd812788bf287e12d08bdee
--- /dev/null
+++ b/runtime/bin/vmservice/client/lib/src/observatory_elements/navigation_bar_isolate.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2014, 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 navigation_bar_isolate_element;
+
+import 'observatory_element.dart';
+import 'package:polymer/polymer.dart';
+
+@CustomTag('navigation-bar-isolate')
+class NavigationBarIsolateElement extends ObservatoryElement {
+ NavigationBarIsolateElement.created() : super.created();
+ @observable List<String> links = toObservable(
+ [ 'Stacktrace', 'Library', 'CPU Profile']);
+
+ void appChanged(oldValue) {
+ super.appChanged(oldValue);
+ notifyPropertyChange(#currentIsolateName, '', currentIsolateName);
+ }
+
+ String currentIsolateName() {
+ if (app == null) {
+ return '';
+ }
+ print('Fetching name');
+ var isolate = app.locationManager.currentIsolate();
+ if (isolate == null) {
+ return '';
+ }
+ return isolate.name;
+ }
+
+ String currentIsolateLink(String link) {
+ if (app == null) {
+ return '';
+ }
+ switch (link) {
+ case 'Stacktrace':
+ return app.locationManager.currentIsolateRelativeLink('stacktrace');
+ case 'Library':
+ return app.locationManager.currentIsolateRelativeLink('library');
+ case 'CPU Profile':
+ return app.locationManager.currentIsolateRelativeLink('profile');
+ default:
+ return app.locationManager.currentIsolateRelativeLink('');
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698