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