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

Unified Diff: tests/lib/mirrors/proxy_type_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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: tests/lib/mirrors/proxy_type_test.dart
diff --git a/tests/lib/mirrors/proxy_type_test.dart b/tests/lib/mirrors/proxy_type_test.dart
index acc74db4653f4433b4502455dbb43a357134ea8f..358fe59ed05e85127e925c10ea4229f1faf536b6 100644
--- a/tests/lib/mirrors/proxy_type_test.dart
+++ b/tests/lib/mirrors/proxy_type_test.dart
@@ -20,12 +20,14 @@ class Alice {
sayFooUnattenuated() {
bob.foo(carol);
}
+
sayFooAttenuated() {
bool enabled = true;
bool gate() => enabled;
bob.foo(new CarolCaretaker(carol, gate));
- enabled = false; // Attenuate a capability
+ enabled = false; // Attenuate a capability
}
+
sayBar() {
bob.bar();
}
@@ -34,9 +36,10 @@ class Alice {
class Bob {
Carol savedCarol;
foo(Carol carol) {
- savedCarol = carol; // Store a capability
+ savedCarol = carol; // Store a capability
carol.foo();
}
+
bar() {
savedCarol.foo();
}
@@ -64,20 +67,18 @@ class CarolCaretaker implements Carol {
main() {
Alice alice1 = new Alice();
alice1.sayFooUnattenuated();
- alice1.sayBar(); // Bob still has authority to use Carol
+ alice1.sayBar(); // Bob still has authority to use Carol
Alice alice2 = new Alice();
alice2.sayFooAttenuated();
- Expect.throws(() => alice2.sayBar(),
- (e) => e is NoSuchMethodError,
- 'Authority should have been attenuated');
+ Expect.throws(() => alice2.sayBar(), (e) => e is NoSuchMethodError,
+ 'Authority should have been attenuated');
// At the base level, a caretaker for a Carol masquerades as a Carol.
- CarolCaretaker caretaker = new CarolCaretaker(new Carol(), ()=>true);
+ CarolCaretaker caretaker = new CarolCaretaker(new Carol(), () => true);
Expect.isTrue(caretaker is Carol);
Expect.equals(Carol, caretaker.runtimeType);
// At the reflective level, the caretaker is distinguishable.
- Expect.equals(reflectClass(CarolCaretaker),
- reflect(caretaker).type);
+ Expect.equals(reflectClass(CarolCaretaker), reflect(caretaker).type);
}

Powered by Google App Engine
This is Rietveld 408576698