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

Unified Diff: runtime/observatory/tests/observatory_ui/error_ref/element_test.dart

Issue 2202943002: Converted Observatory error-ref element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
Index: runtime/observatory/tests/observatory_ui/error_ref/element_test.dart
diff --git a/runtime/observatory/tests/observatory_ui/code_ref/element_test.dart b/runtime/observatory/tests/observatory_ui/error_ref/element_test.dart
similarity index 54%
copy from runtime/observatory/tests/observatory_ui/code_ref/element_test.dart
copy to runtime/observatory/tests/observatory_ui/error_ref/element_test.dart
index 0e2c9ee6dc95f302c653d79750958cb0ac66871d..049565607089d89cdeace496ec1aeb373d052fa3 100644
--- a/runtime/observatory/tests/observatory_ui/code_ref/element_test.dart
+++ b/runtime/observatory/tests/observatory_ui/error_ref/element_test.dart
@@ -3,27 +3,29 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:html';
import 'package:unittest/unittest.dart';
+import 'package:observatory/models.dart';
import 'package:observatory/mocks.dart';
-import 'package:observatory/src/elements/code_ref.dart';
+import 'package:observatory/src/elements/error_ref.dart';
-main(){
- CodeRefElement.tag.ensureRegistration();
+main() {
+ ErrorRefElement.tag.ensureRegistration();
- final IsolateRefMock isolate = new IsolateRefMock(id: 'i-id', name: 'i-name');
- final CodeRefMock code = new CodeRefMock(id: 'c-id', name: 'c-name');
+ final ErrorRef ref = new ErrorRefMock(id: 'id', message: 'fixed-error-m');
test('instantiation', () {
- final CodeRefElement e = new CodeRefElement(isolate, code);
+ final ErrorRefElement e = new ErrorRefElement(ref);
expect(e, isNotNull, reason: 'element correctly created');
- expect(e.isolate, equals(isolate));
- expect(e.code, equals(code));
+ expect(e.error, equals(ref));
});
test('elements created after attachment', () async {
- final CodeRefElement e = new CodeRefElement(isolate, code);
+ final ErrorRefElement e = new ErrorRefElement(ref);
document.body.append(e);
await e.onRendered.first;
expect(e.children.length, isNonZero, reason: 'has elements');
+ expect(e.innerHtml.contains(ref.message), isTrue,
+ reason: 'no message in the component');
e.remove();
await e.onRendered.first;
- expect(e.children.length, isZero, reason: 'is empty');
+ expect(e.children.length, isZero,
+ reason: 'is empty');
});
}
« no previous file with comments | « runtime/observatory/observatory_sources.gypi ('k') | runtime/observatory/tests/observatory_ui/error_ref/element_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698