anchor.diff:          // TODO: Delay a bit - there's a race condition.
           return new Future.delayed(new Duration(milliseconds: 100));
         }).then((_) {
  -        return _getAppId(launchContainer.name);
  -      }).then((String id) {
  -        if (id == null) {
  -          throw 'Unable to locate an application id.';
  -        } else if (!management.available) {
  -          throw 'The chrome.management API is not available.';
  +        if (id != null) {
  +          return launchId(id);
           } else {
  -          return management.launchApp(id);
  +           return _getAppId(launchContainer.name).then((String id)
  +               => launchId(id));
           }
         });
       });
  +  }
  +
  +  /**
  +  * Launches a chrome app with given [id].
  +  */
  +  Future launchId(String id) {
  +    if (id == null) {
  +      throw 'Unable to locate an application id.';
  +    } else if (!management.available) {
  +      throw 'The chrome.management API is not available.';
  +    } else {
  +      return management.launchApp(id);
  +    }
     }
   
     /**
  
positive.code: 
    Future run(Resource resource) {
      Container launchContainer = getAppContainerFor(resource);
      return updateManifest(launchContainer.entry).then((_) {
        return developerPrivate.loadDirectory(launchContainer.entry).then(
            (String appId) {
          // TODO: Use the returned appId once it has the correct results.
  
negative.code:           String key = manifestDict['key'];
            if (id == SPARK_NIGHTLY_ID && key == SPARK_NIGHTLY_KEY) {
              manifestDict['key'] = SPARK_RELEASE_KEY;
              launchId = SPARK_RELEASE_ID;
            } else if (id == SPARK_RELEASE_ID && key == SPARK_RELEASE_KEY) {
              manifestDict['key'] = SPARK_NIGHTLY_KEY;
              launchId = SPARK_NIGHTLY_ID;
            } else {
              return new Future.value();
            }
            // This modifies the manifest file permanently.
            return entry.writeText(new JsonPrinter().print(manifestDict)).then(
                (_) {
              return new Future.value(launchId);
            });
          });
        });
      } else {
  