| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "chrome/service/service_process_prefs.h" | 10 #include "chrome/service/service_process_prefs.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // Test ability to retrieve prefs | 34 // Test ability to retrieve prefs |
| 35 TEST_F(ServiceProcessPrefsTest, RetrievePrefs) { | 35 TEST_F(ServiceProcessPrefsTest, RetrievePrefs) { |
| 36 prefs_->SetBoolean("testb", true); | 36 prefs_->SetBoolean("testb", true); |
| 37 prefs_->SetString("tests", "testvalue"); | 37 prefs_->SetString("tests", "testvalue"); |
| 38 prefs_->WritePrefs(); | 38 prefs_->WritePrefs(); |
| 39 MessageLoop::current()->RunAllPending(); | 39 MessageLoop::current()->RunAllPending(); |
| 40 prefs_->SetBoolean("testb", false); // overwrite | 40 prefs_->SetBoolean("testb", false); // overwrite |
| 41 prefs_->SetString("tests", ""); // overwrite | 41 prefs_->SetString("tests", ""); // overwrite |
| 42 prefs_->ReadPrefs(); | 42 prefs_->ReadPrefs(); |
| 43 bool testb; | 43 EXPECT_EQ(prefs_->GetBoolean("testb", false), true); |
| 44 prefs_->GetBoolean("testb", &testb); | 44 EXPECT_EQ(prefs_->GetString("tests", ""), "testvalue"); |
| 45 EXPECT_EQ(testb, true); | |
| 46 std::string tests; | |
| 47 prefs_->GetString("tests", &tests); | |
| 48 EXPECT_EQ(tests, "testvalue"); | |
| 49 } | 45 } |
| 50 | 46 |
| OLD | NEW |