function promise_setup(func, properties={})
    {
        if (typeof func !== "function") {
            tests.set_status(tests.status.ERROR,
                             "`promise_setup` invoked without a function");
            tests.complete();
            return;
        }
        tests.promise_setup_called = true;

        if (!tests.promise_tests) {
            tests.promise_tests = Promise.resolve();
        }

        tests.promise_tests = tests.promise_tests
            .then(function()
                  {
                      var result;

                      tests.setup(null, properties);
                      result = func();
                      test_environment.on_new_harness_properties(properties);

                      if (!result || typeof result.then !== "function") {
                          throw "Non-thenable returned by function passed to `promise_setup`";
                      }
                      return result;
                  })
            .catch(function(e)
                   {
                       tests.set_status(tests.status.ERROR,
                                        String(e),
                                        e && e.stack);
                       tests.complete();
                   });
    }
Configure the harness, waiting for a promise to resolve
before running any `promise_test` tests.

@param {Function} func - Function returning a promise that's
run synchronously. Promise tests are not run until after this
function has resolved.
@param {SettingsObject} [properties] - An object containing
the harness settings to use.