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 "chrome/browser/history/android/android_provider_backend.h" | 5 #include "chrome/browser/history/android/android_provider_backend.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1132 | 1132 |
1133 int update_count; | 1133 int update_count; |
1134 std::vector<string16> update_args; | 1134 std::vector<string16> update_args; |
1135 // Update the last visit time to a value greater than current one. | 1135 // Update the last visit time to a value greater than current one. |
1136 HistoryAndBookmarkRow update_row1; | 1136 HistoryAndBookmarkRow update_row1; |
1137 | 1137 |
1138 // Set favicon. | 1138 // Set favicon. |
1139 std::vector<unsigned char> data; | 1139 std::vector<unsigned char> data; |
1140 data.push_back('1'); | 1140 data.push_back('1'); |
1141 update_row1.set_favicon(base::RefCountedBytes::TakeVector(&data)); | 1141 update_row1.set_favicon(base::RefCountedBytes::TakeVector(&data)); |
1142 // the content of data is swapped, so reset it to compare with | |
1143 // the result of GetFavicon | |
1144 data.push_back('1'); | |
pkotwicz
2012/08/20 14:17:29
You can actually use new RefCountedBytes(data) ins
| |
1142 update_args.push_back(UTF8ToUTF16(row1.raw_url())); | 1145 update_args.push_back(UTF8ToUTF16(row1.raw_url())); |
1143 delegate_.ResetDetails(); | 1146 delegate_.ResetDetails(); |
1144 ASSERT_TRUE(backend->UpdateHistoryAndBookmarks(update_row1, "url = ?", | 1147 ASSERT_TRUE(backend->UpdateHistoryAndBookmarks(update_row1, "url = ?", |
1145 update_args, &update_count)); | 1148 update_args, &update_count)); |
1146 // Verify notifications. | 1149 // Verify notifications. |
1147 EXPECT_FALSE(delegate_.deleted_details()); | 1150 EXPECT_FALSE(delegate_.deleted_details()); |
1148 EXPECT_FALSE(delegate_.modified_details()); | 1151 EXPECT_FALSE(delegate_.modified_details()); |
1149 ASSERT_TRUE(delegate_.favicon_details()); | 1152 ASSERT_TRUE(delegate_.favicon_details()); |
1150 ASSERT_EQ(1u, delegate_.favicon_details()->urls.size()); | 1153 ASSERT_EQ(1u, delegate_.favicon_details()->urls.size()); |
1151 ASSERT_TRUE(delegate_.favicon_details()->urls.end() != | 1154 ASSERT_TRUE(delegate_.favicon_details()->urls.end() != |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1751 // Query by folder=1, the row2 should returned. | 1754 // Query by folder=1, the row2 should returned. |
1752 statement.reset(backend->QueryHistoryAndBookmarks( | 1755 statement.reset(backend->QueryHistoryAndBookmarks( |
1753 projections, std::string("folder=1"), std::vector<string16>(), | 1756 projections, std::string("folder=1"), std::vector<string16>(), |
1754 std::string("url ASC"))); | 1757 std::string("url ASC"))); |
1755 ASSERT_TRUE(statement->statement()->Step()); | 1758 ASSERT_TRUE(statement->statement()->Step()); |
1756 EXPECT_EQ(row2.url(), GURL(statement->statement()->ColumnString(0))); | 1759 EXPECT_EQ(row2.url(), GURL(statement->statement()->ColumnString(0))); |
1757 EXPECT_FALSE(statement->statement()->Step()); | 1760 EXPECT_FALSE(statement->statement()->Step()); |
1758 } | 1761 } |
1759 | 1762 |
1760 } // namespace history | 1763 } // namespace history |
OLD | NEW |