OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/update_operation.h" | 5 #include "chrome/browser/chromeos/drive/file_system/update_operation.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/drive/file_system/operation_test_base.h" | 7 #include "chrome/browser/chromeos/drive/file_system/operation_test_base.h" |
8 #include "chrome/browser/chromeos/drive/file_system_interface.h" | 8 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
9 #include "chrome/browser/google_apis/fake_drive_service.h" | 9 #include "chrome/browser/google_apis/fake_drive_service.h" |
10 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 10 #include "chrome/browser/google_apis/gdata_wapi_parser.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 EXPECT_EQ(FILE_ERROR_OK, error); | 60 EXPECT_EQ(FILE_ERROR_OK, error); |
61 | 61 |
62 // Add the dirty bit. | 62 // Add the dirty bit. |
63 error = FILE_ERROR_FAILED; | 63 error = FILE_ERROR_FAILED; |
64 cache()->MarkDirtyOnUIThread( | 64 cache()->MarkDirtyOnUIThread( |
65 kResourceId, kMd5, | 65 kResourceId, kMd5, |
66 google_apis::test_util::CreateCopyResultCallback(&error)); | 66 google_apis::test_util::CreateCopyResultCallback(&error)); |
67 google_apis::test_util::RunBlockingPoolTask(); | 67 google_apis::test_util::RunBlockingPoolTask(); |
68 EXPECT_EQ(FILE_ERROR_OK, error); | 68 EXPECT_EQ(FILE_ERROR_OK, error); |
69 | 69 |
70 // Commit the dirty bit. | |
71 error = FILE_ERROR_FAILED; | |
72 cache()->CommitDirtyOnUIThread( | |
73 kResourceId, kMd5, | |
74 google_apis::test_util::CreateCopyResultCallback(&error)); | |
75 google_apis::test_util::RunBlockingPoolTask(); | |
76 EXPECT_EQ(FILE_ERROR_OK, error); | |
77 | |
78 int64 original_changestamp = fake_service()->largest_changestamp(); | 70 int64 original_changestamp = fake_service()->largest_changestamp(); |
79 | 71 |
80 // The callback will be called upon completion of | 72 // The callback will be called upon completion of |
81 // UpdateFileByResourceId(). | 73 // UpdateFileByResourceId(). |
82 error = FILE_ERROR_FAILED; | 74 error = FILE_ERROR_FAILED; |
83 operation_->UpdateFileByResourceId( | 75 operation_->UpdateFileByResourceId( |
84 kResourceId, | 76 kResourceId, |
85 ClientContext(USER_INITIATED), | 77 ClientContext(USER_INITIATED), |
86 google_apis::test_util::CreateCopyResultCallback(&error)); | 78 google_apis::test_util::CreateCopyResultCallback(&error)); |
87 google_apis::test_util::RunBlockingPoolTask(); | 79 google_apis::test_util::RunBlockingPoolTask(); |
(...skipping 20 matching lines...) Expand all Loading... |
108 operation_->UpdateFileByResourceId( | 100 operation_->UpdateFileByResourceId( |
109 "file:nonexistent_resource_id", | 101 "file:nonexistent_resource_id", |
110 ClientContext(USER_INITIATED), | 102 ClientContext(USER_INITIATED), |
111 google_apis::test_util::CreateCopyResultCallback(&error)); | 103 google_apis::test_util::CreateCopyResultCallback(&error)); |
112 google_apis::test_util::RunBlockingPoolTask(); | 104 google_apis::test_util::RunBlockingPoolTask(); |
113 EXPECT_EQ(FILE_ERROR_NOT_FOUND, error); | 105 EXPECT_EQ(FILE_ERROR_NOT_FOUND, error); |
114 } | 106 } |
115 | 107 |
116 } // namespace file_system | 108 } // namespace file_system |
117 } // namespace drive | 109 } // namespace drive |
OLD | NEW |