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

Side by Side Diff: services/preferences/public/cpp/tests/pref_observer_store_unittest.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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
« no previous file with comments | « remoting/test/remote_host_info_fetcher.cc ('k') | third_party/libaddressinput/chromium/json.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/preferences/public/cpp/pref_observer_store.h" 5 #include "services/preferences/public/cpp/pref_observer_store.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 EXPECT_NE(observer()->changed_keys.end(), 260 EXPECT_NE(observer()->changed_keys.end(),
261 std::find(observer()->changed_keys.begin(), 261 std::find(observer()->changed_keys.begin(),
262 observer()->changed_keys.end(), key1)); 262 observer()->changed_keys.end(), key1));
263 EXPECT_NE(observer()->changed_keys.end(), 263 EXPECT_NE(observer()->changed_keys.end(),
264 std::find(observer()->changed_keys.begin(), 264 std::find(observer()->changed_keys.begin(),
265 observer()->changed_keys.end(), key2)); 265 observer()->changed_keys.end(), key2));
266 266
267 // Change an item within the nested dictionary 267 // Change an item within the nested dictionary
268 base::Value* result = nullptr; 268 base::Value* result = nullptr;
269 store()->GetMutableValue(key1, &result); 269 store()->GetMutableValue(key1, &result);
270 EXPECT_EQ(base::Value::TYPE_DICTIONARY, result->GetType()); 270 EXPECT_EQ(base::Value::Type::DICTIONARY, result->GetType());
271 EXPECT_TRUE(result->Equals(&sub_dictionary1)); 271 EXPECT_TRUE(result->Equals(&sub_dictionary1));
272 272
273 base::DictionaryValue* dictionary_result = nullptr; 273 base::DictionaryValue* dictionary_result = nullptr;
274 result->GetAsDictionary(&dictionary_result); 274 result->GetAsDictionary(&dictionary_result);
275 EXPECT_NE(nullptr, dictionary_result); 275 EXPECT_NE(nullptr, dictionary_result);
276 276
277 const std::string sub_key3("????"); 277 const std::string sub_key3("????");
278 const int kValue3 = 9001; 278 const int kValue3 = 9001;
279 base::FundamentalValue pref3(kValue3); 279 base::FundamentalValue pref3(kValue3);
280 dictionary_result->Set(sub_key3, pref3.CreateDeepCopy()); 280 dictionary_result->Set(sub_key3, pref3.CreateDeepCopy());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 observer()->changed_keys.end(), key2)); 326 observer()->changed_keys.end(), key2));
327 327
328 observer()->changed_keys.clear(); 328 observer()->changed_keys.clear();
329 const int kValue3 = 9001; 329 const int kValue3 = 9001;
330 base::FundamentalValue pref3(kValue3); 330 base::FundamentalValue pref3(kValue3);
331 store()->SetValue(key1, pref3.CreateDeepCopy(), 0); 331 store()->SetValue(key1, pref3.CreateDeepCopy(), 0);
332 base::RunLoop().RunUntilIdle(); 332 base::RunLoop().RunUntilIdle();
333 EXPECT_EQ(1u, observer()->changed_keys.size()); 333 EXPECT_EQ(1u, observer()->changed_keys.size());
334 EXPECT_TRUE(manager()->set_preferences_called()); 334 EXPECT_TRUE(manager()->set_preferences_called());
335 } 335 }
OLDNEW
« no previous file with comments | « remoting/test/remote_host_info_fetcher.cc ('k') | third_party/libaddressinput/chromium/json.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698