function testScheduleTask_Prioritize() {
  var resolver = goog.Promise.withResolver();
  var executionOrder = [];

  var task1 = new lf.testing.MockTask(
      lf.TransactionType.READ_WRITE,
      createScope(),
      function() { return resolver.promise; },
      lf.proc.TaskPriority.USER_QUERY_TASK);
  var task2 = new lf.testing.MockTask(
      lf.TransactionType.READ_WRITE,
      createScope(),
      function() { executionOrder.push('task2'); },
      lf.proc.TaskPriority.TRANSACTION_TASK);
  var task3 = new lf.testing.MockTask(
      lf.TransactionType.READ_WRITE,
      createScope(),
      function() { executionOrder.push('task3'); },
      lf.proc.TaskPriority.EXTERNAL_CHANGE_TASK);
  var task4 = new lf.testing.MockTask(
      lf.TransactionType.READ_WRITE,
      createScope(),
      function() { executionOrder.push('task4'); },
      lf.proc.TaskPriority.OBSERVER_QUERY_TASK);

  var p1 = runner.scheduleTask(task1);
  var p2 = runner.scheduleTask(task2);
  var p3 = runner.scheduleTask(task3);
  var p4 = runner.scheduleTask(task4);
  resolver.resolve();

  return goog.Promise.all([p1, p2, p3, p4]).then(function() {
    // Ensuring that the prioritized task3 executed before task2.
    assertArrayEquals(['task4', 'task3', 'task2'], executionOrder);
  });
}
Tests that prioritized tasks are placed in the front of the queue.
@return {!IThenable}