OLD | NEW |
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 "base/prefs/overlay_user_pref_store.h" |
| 6 #include "base/prefs/pref_store_observer_mock.h" |
| 7 #include "base/prefs/testing_pref_store.h" |
5 #include "base/values.h" | 8 #include "base/values.h" |
6 #include "chrome/browser/prefs/overlay_user_pref_store.h" | |
7 #include "chrome/browser/prefs/testing_pref_store.h" | |
8 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
9 #include "chrome/common/pref_store_observer_mock.h" | |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 using ::testing::Mock; | 13 using ::testing::Mock; |
14 using ::testing::StrEq; | 14 using ::testing::StrEq; |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 const char* overlay_key = prefs::kBrowserWindowPlacement; | 18 const char* overlay_key = prefs::kBrowserWindowPlacement; |
19 const char* regular_key = prefs::kShowBookmarkBar; | 19 const char* regular_key = prefs::kShowBookmarkBar; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 overlay_->RemoveObserver(&obs); | 274 overlay_->RemoveObserver(&obs); |
275 | 275 |
276 // Check successful unsubscription. | 276 // Check successful unsubscription. |
277 EXPECT_CALL(obs, OnPrefValueChanged(StrEq(mapped_overlay_key))).Times(0); | 277 EXPECT_CALL(obs, OnPrefValueChanged(StrEq(mapped_overlay_key))).Times(0); |
278 EXPECT_CALL(obs, OnPrefValueChanged(StrEq(mapped_underlay_key))).Times(0); | 278 EXPECT_CALL(obs, OnPrefValueChanged(StrEq(mapped_underlay_key))).Times(0); |
279 underlay_->SetValue(mapped_underlay_key, Value::CreateIntegerValue(47)); | 279 underlay_->SetValue(mapped_underlay_key, Value::CreateIntegerValue(47)); |
280 overlay_->SetValue(mapped_overlay_key, Value::CreateIntegerValue(48)); | 280 overlay_->SetValue(mapped_overlay_key, Value::CreateIntegerValue(48)); |
281 Mock::VerifyAndClearExpectations(&obs); | 281 Mock::VerifyAndClearExpectations(&obs); |
282 } | 282 } |
OLD | NEW |