OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/gfx/codec/jpeg_codec.h" | 5 #include "app/gfx/codec/jpeg_codec.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 std::string segment_name = VisitSegmentDatabase::ComputeSegmentName(url); | 452 std::string segment_name = VisitSegmentDatabase::ComputeSegmentName(url); |
453 EXPECT_EQ(0, backend_->db()->GetSegmentNamed(segment_name)); | 453 EXPECT_EQ(0, backend_->db()->GetSegmentNamed(segment_name)); |
454 | 454 |
455 // One visit should be added. | 455 // One visit should be added. |
456 VisitVector visits; | 456 VisitVector visits; |
457 EXPECT_TRUE(backend_->db()->GetVisitsForURL(url_id, &visits)); | 457 EXPECT_TRUE(backend_->db()->GetVisitsForURL(url_id, &visits)); |
458 EXPECT_EQ(1U, visits.size()); | 458 EXPECT_EQ(1U, visits.size()); |
459 | 459 |
460 // But no visible visits. | 460 // But no visible visits. |
461 visits.clear(); | 461 visits.clear(); |
462 backend_->db()->GetVisibleVisitsInRange( | 462 backend_->db()->GetVisibleVisitsInRange(base::Time(), base::Time(), 1, |
463 base::Time(), base::Time(), false, 1, &visits); | 463 &visits); |
464 EXPECT_TRUE(visits.empty()); | 464 EXPECT_TRUE(visits.empty()); |
465 | 465 |
466 // Expire the visits. | 466 // Expire the visits. |
467 backend_->expire_backend()->ExpireHistoryBetween(visit_time, Time::Now()); | 467 backend_->expire_backend()->ExpireHistoryBetween(visit_time, Time::Now()); |
468 | 468 |
469 // The visit should have been nuked. | 469 // The visit should have been nuked. |
470 visits.clear(); | 470 visits.clear(); |
471 EXPECT_TRUE(backend_->db()->GetVisitsForURL(url_id, &visits)); | 471 EXPECT_TRUE(backend_->db()->GetVisitsForURL(url_id, &visits)); |
472 EXPECT_TRUE(visits.empty()); | 472 EXPECT_TRUE(visits.empty()); |
473 | 473 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 | 555 |
556 // If the URL is bookmarked, it should get added to history with 0 visits. | 556 // If the URL is bookmarked, it should get added to history with 0 visits. |
557 bookmark_model_.AddURL(bookmark_model_.GetBookmarkBarNode(), 0, | 557 bookmark_model_.AddURL(bookmark_model_.GetBookmarkBarNode(), 0, |
558 std::wstring(), url3); | 558 std::wstring(), url3); |
559 backend_->SetImportedFavicons(favicons); | 559 backend_->SetImportedFavicons(favicons); |
560 EXPECT_FALSE(backend_->db_->GetRowForURL(url3, &url_row3) == 0); | 560 EXPECT_FALSE(backend_->db_->GetRowForURL(url3, &url_row3) == 0); |
561 EXPECT_TRUE(url_row3.visit_count() == 0); | 561 EXPECT_TRUE(url_row3.visit_count() == 0); |
562 } | 562 } |
563 | 563 |
564 } // namespace history | 564 } // namespace history |
OLD | NEW |