Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: chrome/browser/chromeos/drive/file_system/get_file_for_saving_operation_unittest.cc

Issue 137423010: drive: Support offline file creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/get_file_for_saving_operatio n.h" 5 #include "chrome/browser/chromeos/drive/file_system/get_file_for_saving_operatio n.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 22 matching lines...) Expand all
33 const std::string& observerd_local_id() const { 33 const std::string& observerd_local_id() const {
34 return observed_local_id_; 34 return observed_local_id_;
35 } 35 }
36 36
37 // OperationObserver overrides. 37 // OperationObserver overrides.
38 virtual void OnDirectoryChangedByOperation( 38 virtual void OnDirectoryChangedByOperation(
39 const base::FilePath& path) OVERRIDE {} 39 const base::FilePath& path) OVERRIDE {}
40 40
41 virtual void OnEntryUpdatedByOperation(const std::string& local_id) OVERRIDE { 41 virtual void OnEntryUpdatedByOperation(const std::string& local_id) OVERRIDE {
42 observed_local_id_ = local_id; 42 observed_local_id_ = local_id;
43 quit_closure_.Run(); 43 if (!quit_closure_.is_null())
hashimoto 2014/01/30 04:25:51 This null check is needed because CreateFileOprera
44 quit_closure_.Run();
44 } 45 }
45 46
46 private: 47 private:
47 std::string observed_local_id_; 48 std::string observed_local_id_;
48 base::Closure quit_closure_; 49 base::Closure quit_closure_;
49 }; 50 };
50 51
51 } // namespace 52 } // namespace
52 53
53 class GetFileForSavingOperationTest : public OperationTestBase { 54 class GetFileForSavingOperationTest : public OperationTestBase {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 google_apis::test_util::CreateCopyResultCallback( 156 google_apis::test_util::CreateCopyResultCallback(
156 &error, &local_path, &entry)); 157 &error, &local_path, &entry));
157 test_util::RunBlockingPoolTask(); 158 test_util::RunBlockingPoolTask();
158 159
159 // Checks that an error is returned. 160 // Checks that an error is returned.
160 EXPECT_EQ(FILE_ERROR_EXISTS, error); 161 EXPECT_EQ(FILE_ERROR_EXISTS, error);
161 } 162 }
162 163
163 } // namespace file_system 164 } // namespace file_system
164 } // namespace drive 165 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698