remove unnecessary deps
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 715751a..e6d99f9 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,5 +1,11 @@
analyzer:
errors:
deprecated_member_use_from_same_package: ignore
- strong-mode:
- implicit-casts: false
\ No newline at end of file
+
+linter:
+ rules:
+ - always_declare_return_types
+ - avoid_init_to_null
+ - directives_ordering
+ - slash_for_doc_comments
+ - prefer_final_fields
diff --git a/changelog.md b/changelog.md
index 950a3fa..1f1847f 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,9 @@
# webkit_inspection_protocol.dart
+## 0.5.0
+- removed the bin/multiplex.dart binary to the example/ directory
+- remove dependencies on `package:args`, package:shelf`, and `package:shelf_web_socket`
+
## 0.4.2
- Cast `HttpClientResponse` to `Stream<List<int>>` in response to
SDK breaking change.
diff --git a/bin/multiplex.dart b/example/multiplex.dart
similarity index 92%
rename from bin/multiplex.dart
rename to example/multiplex.dart
index 2b512eb..6ed123d 100644
--- a/bin/multiplex.dart
+++ b/example/multiplex.dart
@@ -8,11 +8,12 @@
import 'package:args/args.dart' show ArgParser;
import 'package:logging/logging.dart'
show hierarchicalLoggingEnabled, Level, Logger, LogRecord;
-import 'package:webkit_inspection_protocol/multiplex.dart' show Server;
import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'
show ChromeConnection;
-main(List<String> argv) async {
+import 'multiplex_impl.dart' show Server;
+
+void main(List<String> argv) async {
var args = (new ArgParser()
..addFlag('verbose', abbr: 'v', defaultsTo: false, negatable: false)
..addFlag('model_dom', defaultsTo: false, negatable: true)
diff --git a/lib/multiplex.dart b/example/multiplex_impl.dart
similarity index 98%
rename from lib/multiplex.dart
rename to example/multiplex_impl.dart
index d877ded..c2e5d5a 100644
--- a/lib/multiplex.dart
+++ b/example/multiplex_impl.dart
@@ -1,7 +1,7 @@
// Copyright 2015 Google. All rights reserved. Use of this source code is
// governed by a BSD-style license that can be found in the LICENSE file.
-library wip.multiplex;
+library wip.multiplex_impl;
import 'dart:async' show Future;
import 'dart:convert' show jsonEncode;
@@ -154,7 +154,7 @@
}
}
- _jsonEncode(obj) {
+ Object _jsonEncode(Object obj) {
if (obj is ChromeTab) {
var json = <String, dynamic>{
'description': obj.description,
diff --git a/lib/dom_model.dart b/lib/dom_model.dart
index 215b9b5..72e70da 100644
--- a/lib/dom_model.dart
+++ b/lib/dom_model.dart
@@ -30,7 +30,7 @@
final WipDom _dom;
- Map<int, _Node> _nodeCache = {};
+ final Map<int, _Node> _nodeCache = {};
Future<_Node> _root;
Stream<AttributeModifiedEvent> onAttributeModified;
@@ -77,39 +77,39 @@
..listen(_logEvent);
}
- _logEvent(WipEvent event) {
+ void _logEvent(WipEvent event) {
_log.finest('Event $event');
}
- _onAttributeModified(
+ void _onAttributeModified(
AttributeModifiedEvent event, EventSink<AttributeModifiedEvent> sink) {
var node = _getOrCreateNode(event.nodeId);
node._attributes[event.name] = event.value;
sink.add(event);
}
- _onAttributeRemoved(
+ void _onAttributeRemoved(
AttributeRemovedEvent event, EventSink<AttributeRemovedEvent> sink) {
var node = _getOrCreateNode(event.nodeId);
node._attributes.remove(event.name);
sink.add(event);
}
- _onCharacterDataModified(CharacterDataModifiedEvent event,
+ void _onCharacterDataModified(CharacterDataModifiedEvent event,
EventSink<CharacterDataModifiedEvent> sink) {
var node = _getOrCreateNode(event.nodeId);
node._nodeValue = event.characterData;
sink.add(event);
}
- _onChildNodeCountUpdated(ChildNodeCountUpdatedEvent event,
+ void _onChildNodeCountUpdated(ChildNodeCountUpdatedEvent event,
EventSink<ChildNodeCountUpdatedEvent> sink) {
var node = _getOrCreateNode(event.nodeId);
node._childNodeCount = event.childNodeCount;
sink.add(event);
}
- _onChildNodeInserted(
+ void _onChildNodeInserted(
ChildNodeInsertedEvent event, EventSink<ChildNodeInsertedEvent> sink) {
var parent = _getOrCreateNode(event.parentNodeId);
int index = 0;
@@ -123,7 +123,7 @@
sink.add(event);
}
- _onChildNodeRemoved(
+ void _onChildNodeRemoved(
ChildNodeRemovedEvent event, EventSink<ChildNodeRemovedEvent> sink) {
var parent = _getOrCreateNode(event.parentNodeId);
var node = _nodeCache.remove(event.nodeId);
@@ -132,14 +132,14 @@
sink.add(event);
}
- _onDocumentUpdated(
+ void _onDocumentUpdated(
DocumentUpdatedEvent event, EventSink<DocumentUpdatedEvent> sink) {
_nodeCache.clear();
_root = null;
sink.add(event);
}
- _onSetChildNodes(
+ void _onSetChildNodes(
SetChildNodesEvent event, EventSink<SetChildNodesEvent> sink) {
var parent = _getOrCreateNode(event.nodeId);
parent._children =
@@ -202,41 +202,50 @@
}
}
- noSuchMethod(Invocation invocation) => reflect(_dom).delegate(invocation);
+ dynamic noSuchMethod(Invocation invocation) =>
+ reflect(_dom).delegate(invocation);
}
class _Node implements Node {
Map<String, String> _attributes;
+
@override
Map<String, String> get attributes =>
_attributes != null ? new UnmodifiableMapView(_attributes) : null;
int _childNodeCount;
+
@override
int get childNodeCount => _childNodeCount;
List<_Node> _children;
+
@override
List<Node> get children =>
_children != null ? new UnmodifiableListView(_children) : null;
_Node _contentDocument;
+
@override
Node get contentDocument => _contentDocument;
String _documentUrl;
+
@override
String get documentUrl => _documentUrl;
String _internalSubset;
+
@override
String get internalSubset => _internalSubset;
String _localName;
+
@override
String get localName => _localName;
String _name;
+
@override
String get name => _name;
@@ -244,30 +253,37 @@
final int nodeId;
String _nodeName;
+
@override
String get nodeName => _nodeName;
int _nodeType;
+
@override
int get nodeType => _nodeType;
String _nodeValue;
+
@override
String get nodeValue => _nodeValue;
String _publicId;
+
@override
String get publicId => _publicId;
String _systemId;
+
@override
String get systemId => _systemId;
String _value;
+
@override
String get value => _value;
String _xmlVersion;
+
@override
String get xmlVersion => _xmlVersion;
diff --git a/lib/src/debugger.dart b/lib/src/debugger.dart
index 5e48c6f..5c3808b 100644
--- a/lib/src/debugger.dart
+++ b/lib/src/debugger.dart
@@ -162,11 +162,9 @@
// "catch", "closure", "global", "local", "with"
String get scope => _map['scope'] as String;
- /**
- * Object representing the scope. For global and with scopes it represents the
- * actual object; for the rest of the scopes, it is artificial transient
- * object enumerating scope variables as its properties.
- */
+ /// Object representing the scope. For global and with scopes it represents
+ /// the actual object; for the rest of the scopes, it is artificial transient
+ /// object enumerating scope variables as its properties.
WipRemoteObject get object =>
new WipRemoteObject(_map['object'] as Map<String, dynamic>);
}
diff --git a/lib/webkit_inspection_protocol.dart b/lib/webkit_inspection_protocol.dart
index bf0fe31..358c951 100644
--- a/lib/webkit_inspection_protocol.dart
+++ b/lib/webkit_inspection_protocol.dart
@@ -26,12 +26,10 @@
export 'src/runtime.dart';
export 'src/target.dart';
-/**
- * A class to connect to a Chrome instance and reflect on its available tabs.
- *
- * This assumes the browser has been started with the `--remote-debugging-port`
- * flag. The data is read from the `http://{host}:{port}/json` url.
- */
+/// A class to connect to a Chrome instance and reflect on its available tabs.
+///
+/// This assumes the browser has been started with the `--remote-debugging-port`
+/// flag. The data is read from the `http://{host}:{port}/json` url.
class ChromeConnection {
final HttpClient _client = new HttpClient();
@@ -119,15 +117,11 @@
String toString() => url;
}
-/**
- * A Webkit Inspection Protocol (WIP) connection.
- */
+/// A Webkit Inspection Protocol (WIP) connection.
class WipConnection {
static final _logger = new Logger('WipConnection');
- /**
- * The WebSocket URL.
- */
+ /// The WebSocket URL.
final String url;
final WebSocket _ws;
@@ -277,7 +271,7 @@
const String optional = 'optional';
abstract class WipDomain {
- Map<String, Stream> _eventStreams = {};
+ final Map<String, Stream> _eventStreams = {};
final WipConnection connection;
Stream<WipDomain> _onClosed;
diff --git a/pubspec.yaml b/pubspec.yaml
index 95705c2..8df358b 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: webkit_inspection_protocol
-version: 0.4.2
-description: A client for the Webkit Inspection Protocol (WIP).
+version: 0.5.0
+description: A client for the Chrome DevTools Protocol (previously called the Webkit Inspection Protocol).
homepage: https://github.com/google/webkit_inspection_protocol.dart
authors:
@@ -8,13 +8,14 @@
- Marc Fisher <fisherii@google.com>
environment:
- sdk: '>=2.0.0-dev.54.0 <3.0.0'
+ sdk: '>=2.0.0 <3.0.0'
dependencies:
- args: '>=0.13.0 <2.0.0'
logging: ^0.11.0
- shelf: ^0.7.0
- shelf_web_socket: ^0.2.0
+
dev_dependencies:
+ args: '>=0.13.0 <2.0.0'
+ shelf: ^0.7.0
shelf_static: ^0.2.0
+ shelf_web_socket: ^0.2.0
test: ^1.0.0
diff --git a/test/console_test.dart b/test/console_test.dart
index 139e06b..9d6727d 100644
--- a/test/console_test.dart
+++ b/test/console_test.dart
@@ -11,7 +11,7 @@
import 'test_setup.dart';
-main() {
+void main() {
group('WipConsole', () {
WipConsole console; // ignore: deprecated_member_use
List<ConsoleMessageEvent> events = [];
@@ -50,7 +50,7 @@
});
test('receives new console messages', () async {
- console.enable();
+ await console.enable();
await navigateToPage('console_test.html');
await checkMessages(4);
});
diff --git a/test/dom_model_test.dart b/test/dom_model_test.dart
index d514243..98f9ca7 100644
--- a/test/dom_model_test.dart
+++ b/test/dom_model_test.dart
@@ -10,7 +10,7 @@
import 'test_setup.dart';
-main() {
+void main() {
group('WipDomModel', () {
WipDom dom;