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

Side by Side Diff: chrome/common/json_pref_store_unittest.cc

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 20 matching lines...) Expand all
31 class MockReadErrorDelegate : public PersistentPrefStore::ReadErrorDelegate { 31 class MockReadErrorDelegate : public PersistentPrefStore::ReadErrorDelegate {
32 public: 32 public:
33 MOCK_METHOD1(OnError, void(PersistentPrefStore::PrefReadError)); 33 MOCK_METHOD1(OnError, void(PersistentPrefStore::PrefReadError));
34 }; 34 };
35 35
36 } // namespace 36 } // namespace
37 37
38 class JsonPrefStoreTest : public testing::Test { 38 class JsonPrefStoreTest : public testing::Test {
39 protected: 39 protected:
40 virtual void SetUp() { 40 virtual void SetUp() {
41 message_loop_proxy_ = base::MessageLoopProxy::CreateForCurrentThread(); 41 message_loop_proxy_ = base::MessageLoopProxy::current();
42 42
43 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 43 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
44 44
45 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_dir_)); 45 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_dir_));
46 data_dir_ = data_dir_.AppendASCII("pref_service"); 46 data_dir_ = data_dir_.AppendASCII("pref_service");
47 ASSERT_TRUE(file_util::PathExists(data_dir_)); 47 ASSERT_TRUE(file_util::PathExists(data_dir_));
48 } 48 }
49 49
50 // The path to temporary directory used to contain the test operations. 50 // The path to temporary directory used to contain the test operations.
51 ScopedTempDir temp_dir_; 51 ScopedTempDir temp_dir_;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 pref_store->ReadPrefsAsync(mock_error_delegate); 237 pref_store->ReadPrefsAsync(mock_error_delegate);
238 238
239 EXPECT_CALL(mock_observer, OnInitializationCompleted(true)).Times(1); 239 EXPECT_CALL(mock_observer, OnInitializationCompleted(true)).Times(1);
240 EXPECT_CALL(*mock_error_delegate, 240 EXPECT_CALL(*mock_error_delegate,
241 OnError(PersistentPrefStore::PREF_READ_ERROR_NO_FILE)).Times(1); 241 OnError(PersistentPrefStore::PREF_READ_ERROR_NO_FILE)).Times(1);
242 message_loop_.RunAllPending(); 242 message_loop_.RunAllPending();
243 pref_store->RemoveObserver(&mock_observer); 243 pref_store->RemoveObserver(&mock_observer);
244 244
245 EXPECT_FALSE(pref_store->ReadOnly()); 245 EXPECT_FALSE(pref_store->ReadOnly());
246 } 246 }
OLDNEW
« no previous file with comments | « chrome/common/json_pref_store.cc ('k') | chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698