| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/drive/file_system.h" | 5 #include "chrome/browser/chromeos/drive/file_system.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/browser/chromeos/drive/test_util.h" | 26 #include "chrome/browser/chromeos/drive/test_util.h" |
| 27 #include "chrome/browser/drive/fake_drive_service.h" | 27 #include "chrome/browser/drive/fake_drive_service.h" |
| 28 #include "chrome/browser/google_apis/drive_api_parser.h" | 28 #include "chrome/browser/google_apis/drive_api_parser.h" |
| 29 #include "chrome/browser/google_apis/test_util.h" | 29 #include "chrome/browser/google_apis/test_util.h" |
| 30 #include "content/public/test/test_browser_thread_bundle.h" | 30 #include "content/public/test/test_browser_thread_bundle.h" |
| 31 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
| 32 | 32 |
| 33 namespace drive { | 33 namespace drive { |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 const int64 kLotsOfSpace = internal::kMinFreeSpace * 10; | |
| 37 | |
| 38 // Counts the number of invocation, and if it increased up to |expected_counter| | 36 // Counts the number of invocation, and if it increased up to |expected_counter| |
| 39 // quits the current message loop by calling |quit|. | 37 // quits the current message loop by calling |quit|. |
| 40 void AsyncInitializationCallback( | 38 void AsyncInitializationCallback( |
| 41 int* counter, int expected_counter, const base::Closure& quit, | 39 int* counter, int expected_counter, const base::Closure& quit, |
| 42 FileError error, scoped_ptr<ResourceEntry> entry) { | 40 FileError error, scoped_ptr<ResourceEntry> entry) { |
| 43 if (error != FILE_ERROR_OK || !entry) { | 41 if (error != FILE_ERROR_OK || !entry) { |
| 44 // If we hit an error case, quit the message loop immediately. | 42 // If we hit an error case, quit the message loop immediately. |
| 45 // Then the expectation in the test case can find it because the actual | 43 // Then the expectation in the test case can find it because the actual |
| 46 // value of |counter| is different from the expected one. | 44 // value of |counter| is different from the expected one. |
| 47 quit.Run(); | 45 quit.Run(); |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 kEmbedOrigin, | 740 kEmbedOrigin, |
| 743 google_apis::test_util::CreateCopyResultCallback(&error, &share_url)); | 741 google_apis::test_util::CreateCopyResultCallback(&error, &share_url)); |
| 744 test_util::RunBlockingPoolTask(); | 742 test_util::RunBlockingPoolTask(); |
| 745 | 743 |
| 746 // Verify the error and the share url, which should be empty. | 744 // Verify the error and the share url, which should be empty. |
| 747 EXPECT_EQ(FILE_ERROR_FAILED, error); | 745 EXPECT_EQ(FILE_ERROR_FAILED, error); |
| 748 EXPECT_TRUE(share_url.is_empty()); | 746 EXPECT_TRUE(share_url.is_empty()); |
| 749 } | 747 } |
| 750 | 748 |
| 751 } // namespace drive | 749 } // namespace drive |
| OLD | NEW |