| 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 <cstdio> | 5 #include <cstdio> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 WaitForCoalescense(); | 645 WaitForCoalescense(); |
| 646 | 646 |
| 647 // We should have no change in results except for one new reset event. | 647 // We should have no change in results except for one new reset event. |
| 648 EXPECT_EQ(6, profile()->add_count()); | 648 EXPECT_EQ(6, profile()->add_count()); |
| 649 EXPECT_EQ(2, profile()->add_event_count()); | 649 EXPECT_EQ(2, profile()->add_event_count()); |
| 650 EXPECT_EQ(1, profile()->reset_event_count()); | 650 EXPECT_EQ(1, profile()->reset_event_count()); |
| 651 } | 651 } |
| 652 | 652 |
| 653 TEST_F(VisitedLinkEventsTest, Basics) { | 653 TEST_F(VisitedLinkEventsTest, Basics) { |
| 654 VisitedLinkMaster* master = profile()->GetVisitedLinkMaster(); | 654 VisitedLinkMaster* master = profile()->GetVisitedLinkMaster(); |
| 655 rvh_tester()->CreateRenderView(string16(), -1); | 655 rvh_tester()->CreateRenderView(string16(), MSG_ROUTING_NONE, -1); |
| 656 | 656 |
| 657 // Add a few URLs. | 657 // Add a few URLs. |
| 658 master->AddURL(GURL("http://acidtests.org/")); | 658 master->AddURL(GURL("http://acidtests.org/")); |
| 659 master->AddURL(GURL("http://google.com/")); | 659 master->AddURL(GURL("http://google.com/")); |
| 660 master->AddURL(GURL("http://chromium.org/")); | 660 master->AddURL(GURL("http://chromium.org/")); |
| 661 | 661 |
| 662 WaitForCoalescense(); | 662 WaitForCoalescense(); |
| 663 | 663 |
| 664 // We now should have 1 add event. | 664 // We now should have 1 add event. |
| 665 EXPECT_EQ(1, profile()->add_event_count()); | 665 EXPECT_EQ(1, profile()->add_event_count()); |
| 666 EXPECT_EQ(0, profile()->reset_event_count()); | 666 EXPECT_EQ(0, profile()->reset_event_count()); |
| 667 | 667 |
| 668 master->DeleteAllURLs(); | 668 master->DeleteAllURLs(); |
| 669 | 669 |
| 670 WaitForCoalescense(); | 670 WaitForCoalescense(); |
| 671 | 671 |
| 672 // We should have no change in add results, plus one new reset event. | 672 // We should have no change in add results, plus one new reset event. |
| 673 EXPECT_EQ(1, profile()->add_event_count()); | 673 EXPECT_EQ(1, profile()->add_event_count()); |
| 674 EXPECT_EQ(1, profile()->reset_event_count()); | 674 EXPECT_EQ(1, profile()->reset_event_count()); |
| 675 } | 675 } |
| 676 | 676 |
| 677 TEST_F(VisitedLinkEventsTest, TabVisibility) { | 677 TEST_F(VisitedLinkEventsTest, TabVisibility) { |
| 678 VisitedLinkMaster* master = profile()->GetVisitedLinkMaster(); | 678 VisitedLinkMaster* master = profile()->GetVisitedLinkMaster(); |
| 679 rvh_tester()->CreateRenderView(string16(), -1); | 679 rvh_tester()->CreateRenderView(string16(), MSG_ROUTING_NONE, -1); |
| 680 | 680 |
| 681 // Simulate tab becoming inactive. | 681 // Simulate tab becoming inactive. |
| 682 rvh_tester()->SimulateWasHidden(); | 682 rvh_tester()->SimulateWasHidden(); |
| 683 | 683 |
| 684 // Add a few URLs. | 684 // Add a few URLs. |
| 685 master->AddURL(GURL("http://acidtests.org/")); | 685 master->AddURL(GURL("http://acidtests.org/")); |
| 686 master->AddURL(GURL("http://google.com/")); | 686 master->AddURL(GURL("http://google.com/")); |
| 687 master->AddURL(GURL("http://chromium.org/")); | 687 master->AddURL(GURL("http://chromium.org/")); |
| 688 | 688 |
| 689 WaitForCoalescense(); | 689 WaitForCoalescense(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 712 EXPECT_EQ(1, profile()->add_event_count()); | 712 EXPECT_EQ(1, profile()->add_event_count()); |
| 713 EXPECT_EQ(0, profile()->reset_event_count()); | 713 EXPECT_EQ(0, profile()->reset_event_count()); |
| 714 | 714 |
| 715 // Activate the tab. | 715 // Activate the tab. |
| 716 rvh_tester()->SimulateWasRestored(); | 716 rvh_tester()->SimulateWasRestored(); |
| 717 | 717 |
| 718 // We should have only one more reset event. | 718 // We should have only one more reset event. |
| 719 EXPECT_EQ(1, profile()->add_event_count()); | 719 EXPECT_EQ(1, profile()->add_event_count()); |
| 720 EXPECT_EQ(1, profile()->reset_event_count()); | 720 EXPECT_EQ(1, profile()->reset_event_count()); |
| 721 } | 721 } |
| OLD | NEW |