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

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

Issue 2990953002: Fix allocation profile test (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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/observatory_ui/allocation_profile/element_test.dart
diff --git a/runtime/observatory/tests/observatory_ui/allocation_profile/element_test.dart b/runtime/observatory/tests/observatory_ui/allocation_profile/element_test.dart
index 5fe59b9df92e77e22dace5ab1066f80ebd6e0279..6fe8549bc0936fa7072c8e696f9ffab1d698b247 100644
--- a/runtime/observatory/tests/observatory_ui/allocation_profile/element_test.dart
+++ b/runtime/observatory/tests/observatory_ui/allocation_profile/element_test.dart
@@ -128,15 +128,19 @@ main() {
const clazz2 = const ClassRefMock(name: 'class2');
const clazz3 = const ClassRefMock(name: 'class3');
const profile = const AllocationProfileMock(members: const [
+ const ClassHeapStatsMock(clazz: clazz1),
const ClassHeapStatsMock(
clazz: clazz2,
newSpace: const AllocationsMock(
- accumulated: const AllocationCountMock(bytes: 10))),
- const ClassHeapStatsMock(clazz: clazz3),
+ current: const AllocationCountMock(bytes: 10)),
+ oldSpace: const AllocationsMock(
+ current: const AllocationCountMock(bytes: 2))),
const ClassHeapStatsMock(
- clazz: clazz1,
+ clazz: clazz3,
newSpace: const AllocationsMock(
- accumulated: const AllocationCountMock(bytes: 5)))
+ current: const AllocationCountMock(bytes: 5)),
+ oldSpace: const AllocationsMock(
+ current: const AllocationCountMock(bytes: 3)))
]);
final completer = new Completer<AllocationProfileMock>();
final repo = new AllocationProfileRepositoryMock(
@@ -151,13 +155,19 @@ main() {
await e.onRendered.first;
completer.complete(profile);
await e.onRendered.first;
+ expect((e.querySelector(cTag) as ClassRefElement).cls, equals(clazz2));
+ e.querySelector('button.name').click();
+ await e.onRendered.first;
expect((e.querySelector(cTag) as ClassRefElement).cls, equals(clazz1));
- e.querySelector('button.bytes').click();
+ e.querySelector('button.name').click();
await e.onRendered.first;
- expect((e.querySelector(cTag) as ClassRefElement).cls, equals(clazz2));
- e.querySelector('button.bytes').click();
+ expect((e.querySelector(cTag) as ClassRefElement).cls, equals(clazz3));
+ e.querySelectorAll('button.bytes').last.click();
await e.onRendered.first;
expect((e.querySelector(cTag) as ClassRefElement).cls, equals(clazz3));
+ e.querySelectorAll('button.bytes').last.click();
+ await e.onRendered.first;
+ expect((e.querySelector(cTag) as ClassRefElement).cls, equals(clazz1));
e.remove();
await e.onRendered.first;
expect(e.children.length, isZero, reason: 'is empty');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698