OLD | NEW |
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 "chrome/browser/chromeos/login/signed_settings_temp_storage.h" | 5 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/scoped_temp_dir.h" | 14 #include "base/scoped_temp_dir.h" |
15 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
16 #include "chrome/common/logging_chrome.h" | 16 #include "chrome/common/logging_chrome.h" |
| 17 #include "chrome/test/base/testing_browser_process_test.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
18 | 19 |
19 namespace chromeos { | 20 namespace chromeos { |
20 | 21 |
21 class SignedSettingsTempStorageTest : public ::testing::Test { | 22 class SignedSettingsTempStorageTest : public TestingBrowserProcessTest { |
22 protected: | 23 protected: |
23 virtual void SetUp() { | 24 virtual void SetUp() { |
24 ref_map_["some_stuff"] = "a=35;code=64"; | 25 ref_map_["some_stuff"] = "a=35;code=64"; |
25 ref_map_["another_stuff"] = ""; | 26 ref_map_["another_stuff"] = ""; |
26 ref_map_["name"] = "value"; | 27 ref_map_["name"] = "value"; |
27 ref_map_["2bc6aa16-e0ea-11df-b13d-18a90520e2e5"] = "512"; | 28 ref_map_["2bc6aa16-e0ea-11df-b13d-18a90520e2e5"] = "512"; |
28 | 29 |
29 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 30 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
30 FilePath temp_file; | 31 FilePath temp_file; |
31 ASSERT_TRUE( | 32 ASSERT_TRUE( |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 EXPECT_TRUE(SignedSettingsTempStorage::Retrieve(b_list[i]->first, &value, | 69 EXPECT_TRUE(SignedSettingsTempStorage::Retrieve(b_list[i]->first, &value, |
69 local_state_.get())); | 70 local_state_.get())); |
70 EXPECT_EQ(b_list[i]->second, value); | 71 EXPECT_EQ(b_list[i]->second, value); |
71 EXPECT_FALSE(SignedSettingsTempStorage::Retrieve("non-existent tv-series", | 72 EXPECT_FALSE(SignedSettingsTempStorage::Retrieve("non-existent tv-series", |
72 &value, | 73 &value, |
73 local_state_.get())); | 74 local_state_.get())); |
74 } | 75 } |
75 } | 76 } |
76 | 77 |
77 } // namespace chromeos | 78 } // namespace chromeos |
OLD | NEW |