njx/brackets-livedev2 — pull request #23 by sebaslv (2014-09-25 14:46:12+00:00)
Title: Add single point for remote scripts to be 'enabled'

I started to write some tests to capture bugs related to CSS support and found that was not guaranteed that web socket connection was already open when the initial related docs message was sent. It seemed to be related to document size since ```DocumentObserver``` relied on ```load``` event while connection was automatically started when loading the script.

This PR fixes that by adding a new piece which provides a starting point for controlling all the start-up sequence: ```ProtocolManager.enable()```. Transport implementation was modified to not automatically start connection by adding a ```connect()``` method so it can be orchestrated as part of the sequence. ```DocumentObserver``` was also modified to be started by ```ProtocolManager``` rather than be automtically executed after document is loaded.

```ProtocolManager``` just controls those pieces now but it would be a point for implementing other management tasks that could be needed on the remote side (eg. dynamically enabling/disabling remote functions)

As part of this PR, some initial tests for the start-up sequence are being added. Previous test for JS related files was replaced by a new and more representative test.