Example #1
0
      init: function() {
        this._super();

        assert.ok(true, 'engine\'s application controller has been instantiated');

        let engineInstance = getOwner(this);
        assert.strictEqual(getEngineParent(engineInstance), appInstance, 'engine instance has appInstance as its parent');
      }
Example #2
0
    synchronous – specifically, a lot of tests assume the last call to
    `app.advanceReadiness()` or `app.reset()` will result in a new instance
    being fully-booted when the current runloop completes.

    We would like new code (like the `visit` API) to stop making this
    assumption, so we created the asynchronous version above that returns a
    promise. But until we have migrated all the code, we would have to expose
    this method for use *internally* in places where we need to boot an instance
    synchronously.

    @private
  */
  _bootSync(options) {
    if (this._booted) { return this; }

    assert('An engine instance\'s parent must be set via `setEngineParent(engine, parent)` prior to calling `engine.boot()`.', getEngineParent(this));

    if (isEnabled('ember-application-engines')) {
      this.cloneParentDependencies();
    }

    this.base.runInstanceInitializers(this);

    this._booted = true;

    return this;
  },

  /**
   Unregister a factory.