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