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 <algorithm> | |
6 #include <string> | 5 #include <string> |
7 #include <utility> | 6 #include <utility> |
8 | 7 |
9 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
11 #include "base/file_path.h" | 10 #include "base/file_path.h" |
12 #include "base/file_util.h" | 11 #include "base/file_util.h" |
13 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
14 #include "base/path_service.h" | 13 #include "base/path_service.h" |
15 #include "base/scoped_temp_dir.h" | 14 #include "base/scoped_temp_dir.h" |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 main_db_->GetVisitsForURL(row.id(), &visits); | 374 main_db_->GetVisitsForURL(row.id(), &visits); |
376 EXPECT_EQ(0U, visits.size()); | 375 EXPECT_EQ(0U, visits.size()); |
377 | 376 |
378 // Thumbnail should be gone. | 377 // Thumbnail should be gone. |
379 // TODO(sky): fix this, see comment in HasThumbnail. | 378 // TODO(sky): fix this, see comment in HasThumbnail. |
380 // EXPECT_FALSE(HasThumbnail(row.id())); | 379 // EXPECT_FALSE(HasThumbnail(row.id())); |
381 | 380 |
382 bool found_delete_notification = false; | 381 bool found_delete_notification = false; |
383 for (size_t i = 0; i < notifications_.size(); i++) { | 382 for (size_t i = 0; i < notifications_.size(); i++) { |
384 if (notifications_[i].first == chrome::NOTIFICATION_HISTORY_URLS_DELETED) { | 383 if (notifications_[i].first == chrome::NOTIFICATION_HISTORY_URLS_DELETED) { |
385 const history::URLRows& rows(reinterpret_cast<URLsDeletedDetails*>( | 384 const URLsDeletedDetails* deleted_details = |
386 notifications_[i].second)->rows); | 385 reinterpret_cast<URLsDeletedDetails*>(notifications_[i].second); |
387 if (std::find_if(rows.begin(), rows.end(), | 386 if (deleted_details->urls.find(row.url()) != |
388 history::URLRow::URLRowHasURL(row.url())) != rows.end()) { | 387 deleted_details->urls.end()) { |
389 found_delete_notification = true; | 388 found_delete_notification = true; |
390 } | 389 } |
391 } else { | 390 } else { |
392 EXPECT_NE(notifications_[i].first, | 391 EXPECT_NE(notifications_[i].first, |
393 chrome::NOTIFICATION_HISTORY_URL_VISITED); | 392 chrome::NOTIFICATION_HISTORY_URL_VISITED); |
394 EXPECT_NE(notifications_[i].first, | 393 EXPECT_NE(notifications_[i].first, |
395 chrome::NOTIFICATION_HISTORY_URLS_MODIFIED); | 394 chrome::NOTIFICATION_HISTORY_URLS_MODIFIED); |
396 } | 395 } |
397 } | 396 } |
398 EXPECT_TRUE(found_delete_notification); | 397 EXPECT_TRUE(found_delete_notification); |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 main_db_->GetVisitsForURL(url_id, &archived_visits); | 952 main_db_->GetVisitsForURL(url_id, &archived_visits); |
954 EXPECT_EQ(0U, archived_visits.size()); | 953 EXPECT_EQ(0U, archived_visits.size()); |
955 } | 954 } |
956 | 955 |
957 // TODO(brettw) add some visits with no URL to make sure everything is updated | 956 // TODO(brettw) add some visits with no URL to make sure everything is updated |
958 // properly. Have the visits also refer to nonexistent FTS rows. | 957 // properly. Have the visits also refer to nonexistent FTS rows. |
959 // | 958 // |
960 // Maybe also refer to invalid favicons. | 959 // Maybe also refer to invalid favicons. |
961 | 960 |
962 } // namespace history | 961 } // namespace history |
OLD | NEW |