Roll src/third_party/WebKit f298044:aa8346d (svn 202628:202629)
[chromium-blink-merge.git] / components / drive / fake_free_disk_space_getter.cc
blob22df758af4a0f9bfc6285a21ef89710a404aedc3
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/drive/fake_free_disk_space_getter.h"
7 #include "components/drive/drive_test_util.h"
9 namespace drive {
11 FakeFreeDiskSpaceGetter::FakeFreeDiskSpaceGetter()
12 : default_value_(test_util::kLotsOfSpace) {
15 FakeFreeDiskSpaceGetter::~FakeFreeDiskSpaceGetter() {
18 void FakeFreeDiskSpaceGetter::PushFakeValue(int64 value) {
19 fake_values_.push_back(value);
22 int64 FakeFreeDiskSpaceGetter::AmountOfFreeDiskSpace() {
23 if (fake_values_.empty())
24 return default_value_;
26 const int64 value = fake_values_.front();
27 fake_values_.pop_front();
28 return value;
31 } // namespace drive