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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/webdata/token_service_table.h" | 10 #include "chrome/browser/webdata/token_service_table.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 EXPECT_TRUE(table_->GetAllTokens(&out_map)); | 83 EXPECT_TRUE(table_->GetAllTokens(&out_map)); |
84 EXPECT_TRUE(out_map.empty()); | 84 EXPECT_TRUE(out_map.empty()); |
85 | 85 |
86 EXPECT_TRUE(table_->SetTokenForService(service, "pepperoni")); | 86 EXPECT_TRUE(table_->SetTokenForService(service, "pepperoni")); |
87 EXPECT_TRUE(table_->GetAllTokens(&out_map)); | 87 EXPECT_TRUE(table_->GetAllTokens(&out_map)); |
88 EXPECT_EQ(out_map.find(service)->second, "pepperoni"); | 88 EXPECT_EQ(out_map.find(service)->second, "pepperoni"); |
89 out_map.clear(); | 89 out_map.clear(); |
90 | 90 |
91 // try blanking it - won't remove it from the db though! | 91 // try blanking it - won't remove it from the db though! |
92 EXPECT_TRUE(table_->SetTokenForService(service, "")); | 92 EXPECT_TRUE(table_->SetTokenForService(service, std::string())); |
93 EXPECT_TRUE(table_->GetAllTokens(&out_map)); | 93 EXPECT_TRUE(table_->GetAllTokens(&out_map)); |
94 EXPECT_EQ(out_map.find(service)->second, ""); | 94 EXPECT_EQ(out_map.find(service)->second, ""); |
95 out_map.clear(); | 95 out_map.clear(); |
96 | 96 |
97 // try mutating it | 97 // try mutating it |
98 EXPECT_TRUE(table_->SetTokenForService(service, "ham")); | 98 EXPECT_TRUE(table_->SetTokenForService(service, "ham")); |
99 EXPECT_TRUE(table_->GetAllTokens(&out_map)); | 99 EXPECT_TRUE(table_->GetAllTokens(&out_map)); |
100 EXPECT_EQ(out_map.find(service)->second, "ham"); | 100 EXPECT_EQ(out_map.find(service)->second, "ham"); |
101 } | 101 } |
OLD | NEW |