| 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/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 | 673 |
| 674 WaitForCoalescense(); | 674 WaitForCoalescense(); |
| 675 | 675 |
| 676 // We should have no change in results except for one new reset event. | 676 // We should have no change in results except for one new reset event. |
| 677 EXPECT_EQ(6, context()->add_count()); | 677 EXPECT_EQ(6, context()->add_count()); |
| 678 EXPECT_EQ(2, context()->add_event_count()); | 678 EXPECT_EQ(2, context()->add_event_count()); |
| 679 EXPECT_EQ(1, context()->reset_event_count()); | 679 EXPECT_EQ(1, context()->reset_event_count()); |
| 680 } | 680 } |
| 681 | 681 |
| 682 TEST_F(VisitedLinkEventsTest, Basics) { | 682 TEST_F(VisitedLinkEventsTest, Basics) { |
| 683 RenderViewHostTester::For(rvh())->CreateRenderView( | 683 RenderViewHostTester::For(rvh())->CreateTestRenderView( |
| 684 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); | 684 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); |
| 685 | 685 |
| 686 // Add a few URLs. | 686 // Add a few URLs. |
| 687 master()->AddURL(GURL("http://acidtests.org/")); | 687 master()->AddURL(GURL("http://acidtests.org/")); |
| 688 master()->AddURL(GURL("http://google.com/")); | 688 master()->AddURL(GURL("http://google.com/")); |
| 689 master()->AddURL(GURL("http://chromium.org/")); | 689 master()->AddURL(GURL("http://chromium.org/")); |
| 690 | 690 |
| 691 WaitForCoalescense(); | 691 WaitForCoalescense(); |
| 692 | 692 |
| 693 // We now should have 1 add event. | 693 // We now should have 1 add event. |
| 694 EXPECT_EQ(1, context()->add_event_count()); | 694 EXPECT_EQ(1, context()->add_event_count()); |
| 695 EXPECT_EQ(0, context()->reset_event_count()); | 695 EXPECT_EQ(0, context()->reset_event_count()); |
| 696 | 696 |
| 697 master()->DeleteAllURLs(); | 697 master()->DeleteAllURLs(); |
| 698 | 698 |
| 699 WaitForCoalescense(); | 699 WaitForCoalescense(); |
| 700 | 700 |
| 701 // We should have no change in add results, plus one new reset event. | 701 // We should have no change in add results, plus one new reset event. |
| 702 EXPECT_EQ(1, context()->add_event_count()); | 702 EXPECT_EQ(1, context()->add_event_count()); |
| 703 EXPECT_EQ(1, context()->reset_event_count()); | 703 EXPECT_EQ(1, context()->reset_event_count()); |
| 704 } | 704 } |
| 705 | 705 |
| 706 TEST_F(VisitedLinkEventsTest, TabVisibility) { | 706 TEST_F(VisitedLinkEventsTest, TabVisibility) { |
| 707 RenderViewHostTester::For(rvh())->CreateRenderView( | 707 RenderViewHostTester::For(rvh())->CreateTestRenderView( |
| 708 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); | 708 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); |
| 709 | 709 |
| 710 // Simulate tab becoming inactive. | 710 // Simulate tab becoming inactive. |
| 711 RenderViewHostTester::For(rvh())->SimulateWasHidden(); | 711 RenderViewHostTester::For(rvh())->SimulateWasHidden(); |
| 712 | 712 |
| 713 // Add a few URLs. | 713 // Add a few URLs. |
| 714 master()->AddURL(GURL("http://acidtests.org/")); | 714 master()->AddURL(GURL("http://acidtests.org/")); |
| 715 master()->AddURL(GURL("http://google.com/")); | 715 master()->AddURL(GURL("http://google.com/")); |
| 716 master()->AddURL(GURL("http://chromium.org/")); | 716 master()->AddURL(GURL("http://chromium.org/")); |
| 717 | 717 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 content::NotificationService::current()->Notify( | 758 content::NotificationService::current()->Notify( |
| 759 content::NOTIFICATION_RENDERER_PROCESS_CREATED, | 759 content::NOTIFICATION_RENDERER_PROCESS_CREATED, |
| 760 content::Source<content::RenderProcessHost>(&different_process_host), | 760 content::Source<content::RenderProcessHost>(&different_process_host), |
| 761 content::NotificationService::NoDetails()); | 761 content::NotificationService::NoDetails()); |
| 762 WaitForCoalescense(); | 762 WaitForCoalescense(); |
| 763 | 763 |
| 764 EXPECT_EQ(0, different_context.new_table_count()); | 764 EXPECT_EQ(0, different_context.new_table_count()); |
| 765 } | 765 } |
| 766 | 766 |
| 767 } // namespace visitedlink | 767 } // namespace visitedlink |
| OLD | NEW |