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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc

Issue 10830181: Implement initialization for GDataCache to use in-memory metadata for tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Style and comment fixes. Created 8 years, 4 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
OLDNEW
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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 mock_webapps_registry_.get(), 250 mock_webapps_registry_.get(),
251 blocking_task_runner_); 251 blocking_task_runner_);
252 252
253 mock_cache_observer_.reset(new StrictMock<MockGDataCacheObserver>); 253 mock_cache_observer_.reset(new StrictMock<MockGDataCacheObserver>);
254 cache_->AddObserver(mock_cache_observer_.get()); 254 cache_->AddObserver(mock_cache_observer_.get());
255 255
256 mock_directory_observer_.reset(new StrictMock<MockDirectoryChangeObserver>); 256 mock_directory_observer_.reset(new StrictMock<MockDirectoryChangeObserver>);
257 file_system_->AddObserver(mock_directory_observer_.get()); 257 file_system_->AddObserver(mock_directory_observer_.get());
258 258
259 file_system_->Initialize(); 259 file_system_->Initialize();
260 cache_->RequestInitializeOnUIThread(); 260 cache_->RequestInitializeOnUIThreadForTesting();
261 test_util::RunBlockingPoolTask(); 261 test_util::RunBlockingPoolTask();
262 } 262 }
263 263
264 virtual void TearDown() OVERRIDE { 264 virtual void TearDown() OVERRIDE {
265 ASSERT_TRUE(file_system_); 265 ASSERT_TRUE(file_system_);
266 EXPECT_CALL(*mock_doc_service_, CancelAll()).Times(1); 266 EXPECT_CALL(*mock_doc_service_, CancelAll()).Times(1);
267 delete file_system_; 267 delete file_system_;
268 file_system_ = NULL; 268 file_system_ = NULL;
269 delete mock_doc_service_; 269 delete mock_doc_service_;
270 mock_doc_service_ = NULL; 270 mock_doc_service_ = NULL;
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after
2617 2617
2618 // Try to close the same file twice. 2618 // Try to close the same file twice.
2619 file_system_->CloseFile(kFileInRoot, close_file_callback); 2619 file_system_->CloseFile(kFileInRoot, close_file_callback);
2620 message_loop_.Run(); 2620 message_loop_.Run();
2621 2621
2622 // It must fail. 2622 // It must fail.
2623 EXPECT_EQ(GDATA_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_); 2623 EXPECT_EQ(GDATA_FILE_ERROR_NOT_FOUND, callback_helper_->last_error_);
2624 } 2624 }
2625 2625
2626 } // namespace gdata 2626 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698