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

Unified Diff: test/plugin_impl_test.dart

Issue 1959373002: Rework plugin API to work better with strong mode (Closed) Base URL: https://github.com/dart-lang/plugin.git@master
Patch Set: Created 4 years, 7 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 | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/plugin_impl_test.dart
diff --git a/test/plugin_impl_test.dart b/test/plugin_impl_test.dart
index 5d2902f302e5fa7026cf72362693a9d40c5f5f29..c8603afbcf5ca70a009d375cc1c69dd6df038a93 100644
--- a/test/plugin_impl_test.dart
+++ b/test/plugin_impl_test.dart
@@ -26,8 +26,8 @@ main() {
test('registerExtension - valid', () {
Plugin plugin = new TestPlugin('plugin');
ExtensionManagerImpl manager = new ExtensionManagerImpl();
- ExtensionPoint point =
- manager.registerExtensionPoint(plugin, 'point', null);
+ ExtensionPoint point = new ExtensionPoint(plugin, 'point', null);
+ manager.registerExtensionPoint(point);
expect(point, isNotNull);
Object extension = 'extension';
manager.registerExtension('plugin.point', extension);
@@ -48,22 +48,24 @@ main() {
Plugin plugin1 = new TestPlugin('plugin1');
Plugin plugin2 = new TestPlugin('plugin2');
ExtensionManagerImpl manager = new ExtensionManagerImpl();
- expect(
- manager.registerExtensionPoint(plugin1, 'point1', null), isNotNull);
- expect(
- manager.registerExtensionPoint(plugin1, 'point2', null), isNotNull);
- expect(
- manager.registerExtensionPoint(plugin2, 'point1', null), isNotNull);
- expect(
- manager.registerExtensionPoint(plugin2, 'point2', null), isNotNull);
+ manager
+ .registerExtensionPoint(new ExtensionPoint(plugin1, 'point1', null));
+ manager
+ .registerExtensionPoint(new ExtensionPoint(plugin1, 'point2', null));
+ manager
+ .registerExtensionPoint(new ExtensionPoint(plugin2, 'point1', null));
+ manager
+ .registerExtensionPoint(new ExtensionPoint(plugin2, 'point2', null));
});
test('registerExtensionPoint - conflicting - same plugin', () {
Plugin plugin1 = new TestPlugin('plugin1');
ExtensionManagerImpl manager = new ExtensionManagerImpl();
+ manager
+ .registerExtensionPoint(new ExtensionPoint(plugin1, 'point1', null));
expect(
- manager.registerExtensionPoint(plugin1, 'point1', null), isNotNull);
- expect(() => manager.registerExtensionPoint(plugin1, 'point1', null),
+ () => manager.registerExtensionPoint(
+ new ExtensionPoint(plugin1, 'point1', null)),
throwsA(new isInstanceOf<ExtensionError>()));
});
@@ -71,9 +73,11 @@ main() {
Plugin plugin1 = new TestPlugin('plugin1');
Plugin plugin2 = new TestPlugin('plugin1');
ExtensionManagerImpl manager = new ExtensionManagerImpl();
+ manager
+ .registerExtensionPoint(new ExtensionPoint(plugin1, 'point1', null));
expect(
- manager.registerExtensionPoint(plugin1, 'point1', null), isNotNull);
- expect(() => manager.registerExtensionPoint(plugin2, 'point1', null),
+ () => manager.registerExtensionPoint(
+ new ExtensionPoint(plugin2, 'point1', null)),
throwsA(new isInstanceOf<ExtensionError>()));
});
});
@@ -117,8 +121,8 @@ main() {
test('add - with validator - valid', () {
Plugin plugin = new TestPlugin('plugin');
- ExtensionPointImpl point = new ExtensionPointImpl(plugin, 'point',
- (Object extension) {
+ ExtensionPointImpl point =
+ new ExtensionPointImpl(plugin, 'point', (Object extension) {
if (extension is! String) {
throw new ExtensionError('');
}
@@ -128,8 +132,8 @@ main() {
test('add - with validator - invalid', () {
Plugin plugin = new TestPlugin('plugin');
- ExtensionPointImpl point = new ExtensionPointImpl(plugin, 'point',
- (Object extension) {
+ ExtensionPointImpl point =
+ new ExtensionPointImpl(plugin, 'point', (Object extension) {
if (extension is! String) {
throw new ExtensionError('');
}
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698