root/chrome/browser/chromeos/drive/fake_free_disk_space_getter.cc

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. PushFakeValue
  2. AmountOfFreeDiskSpace

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h"

#include "chrome/browser/chromeos/drive/test_util.h"

namespace drive {

FakeFreeDiskSpaceGetter::FakeFreeDiskSpaceGetter()
    : default_value_(test_util::kLotsOfSpace) {
}

FakeFreeDiskSpaceGetter::~FakeFreeDiskSpaceGetter() {
}

void FakeFreeDiskSpaceGetter::PushFakeValue(int64 value) {
  fake_values_.push_back(value);
}

int64 FakeFreeDiskSpaceGetter::AmountOfFreeDiskSpace() {
  if (fake_values_.empty())
    return default_value_;

  const int64 value = fake_values_.front();
  fake_values_.pop_front();
  return value;
}

}  // namespace drive

/* [<][>][^][v][top][bottom][index][help] */