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

Side by Side Diff: base/prefs/pref_value_store_unittest.cc

Issue 290083006: Store a stacktrace of PrefService destruction in PrefChangeRegistrar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation Created 6 years, 7 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
« no previous file with comments | « base/prefs/pref_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/prefs/pref_notifier.h" 10 #include "base/prefs/pref_notifier.h"
11 #include "base/prefs/pref_value_store.h" 11 #include "base/prefs/pref_value_store.h"
12 #include "base/prefs/testing_pref_store.h" 12 #include "base/prefs/testing_pref_store.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "testing/gmock/include/gmock/gmock.h" 14 #include "testing/gmock/include/gmock/gmock.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 using testing::Mock; 17 using testing::Mock;
18 using testing::_; 18 using testing::_;
19 19
20 namespace { 20 namespace {
21 21
22 // Allows to capture pref notifications through gmock. 22 // Allows to capture pref notifications through gmock.
23 class MockPrefNotifier : public PrefNotifier { 23 class MockPrefNotifier : public PrefNotifier {
24 public: 24 public:
25 MOCK_METHOD1(OnPreferenceChanged, void(const std::string&)); 25 MOCK_METHOD1(OnPreferenceChanged, void(const std::string&));
26 MOCK_METHOD1(OnInitializationCompleted, void(bool)); 26 MOCK_METHOD1(OnInitializationCompleted, void(bool));
27 // TODO(battre) Remove function. See crbug.com/373435.
28 MOCK_METHOD1(BroadcastPrefServiceDestructionTrace, void(const std::string&));
27 }; 29 };
28 30
29 // Allows to capture sync model associator interaction. 31 // Allows to capture sync model associator interaction.
30 class MockPrefModelAssociator { 32 class MockPrefModelAssociator {
31 public: 33 public:
32 MOCK_METHOD1(ProcessPrefChange, void(const std::string&)); 34 MOCK_METHOD1(ProcessPrefChange, void(const std::string&));
33 }; 35 };
34 36
35 } // namespace 37 } // namespace
36 38
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 prefs::kCommandLinePref)); 663 prefs::kCommandLinePref));
662 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( 664 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable(
663 prefs::kUserPref)); 665 prefs::kUserPref));
664 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( 666 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable(
665 prefs::kRecommendedPref)); 667 prefs::kRecommendedPref));
666 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( 668 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable(
667 prefs::kDefaultPref)); 669 prefs::kDefaultPref));
668 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable( 670 EXPECT_TRUE(pref_value_store_->PrefValueExtensionModifiable(
669 prefs::kMissingPref)); 671 prefs::kMissingPref));
670 } 672 }
OLDNEW
« no previous file with comments | « base/prefs/pref_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698