Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: components/visitedlink/test/visitedlink_unittest.cc

Issue 212703005: Preserve Page::openedByDOM state across process swaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Appease clang Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(base::string16(),
688 MSG_ROUTING_NONE, 688 MSG_ROUTING_NONE,
689 -1); 689 -1, false);
690 690
691 // Add a few URLs. 691 // Add a few URLs.
692 master()->AddURL(GURL("http://acidtests.org/")); 692 master()->AddURL(GURL("http://acidtests.org/"));
693 master()->AddURL(GURL("http://google.com/")); 693 master()->AddURL(GURL("http://google.com/"));
694 master()->AddURL(GURL("http://chromium.org/")); 694 master()->AddURL(GURL("http://chromium.org/"));
695 695
696 WaitForCoalescense(); 696 WaitForCoalescense();
697 697
698 // We now should have 1 add event. 698 // We now should have 1 add event.
699 EXPECT_EQ(1, context()->add_event_count()); 699 EXPECT_EQ(1, context()->add_event_count());
700 EXPECT_EQ(0, context()->reset_event_count()); 700 EXPECT_EQ(0, context()->reset_event_count());
701 701
702 master()->DeleteAllURLs(); 702 master()->DeleteAllURLs();
703 703
704 WaitForCoalescense(); 704 WaitForCoalescense();
705 705
706 // We should have no change in add results, plus one new reset event. 706 // We should have no change in add results, plus one new reset event.
707 EXPECT_EQ(1, context()->add_event_count()); 707 EXPECT_EQ(1, context()->add_event_count());
708 EXPECT_EQ(1, context()->reset_event_count()); 708 EXPECT_EQ(1, context()->reset_event_count());
709 } 709 }
710 710
711 TEST_F(VisitedLinkEventsTest, TabVisibility) { 711 TEST_F(VisitedLinkEventsTest, TabVisibility) {
712 RenderViewHostTester::For(rvh())->CreateRenderView(base::string16(), 712 RenderViewHostTester::For(rvh())->CreateRenderView(base::string16(),
713 MSG_ROUTING_NONE, 713 MSG_ROUTING_NONE,
714 -1); 714 -1, false);
715 715
716 // Simulate tab becoming inactive. 716 // Simulate tab becoming inactive.
717 RenderViewHostTester::For(rvh())->SimulateWasHidden(); 717 RenderViewHostTester::For(rvh())->SimulateWasHidden();
718 718
719 // Add a few URLs. 719 // Add a few URLs.
720 master()->AddURL(GURL("http://acidtests.org/")); 720 master()->AddURL(GURL("http://acidtests.org/"));
721 master()->AddURL(GURL("http://google.com/")); 721 master()->AddURL(GURL("http://google.com/"));
722 master()->AddURL(GURL("http://chromium.org/")); 722 master()->AddURL(GURL("http://chromium.org/"));
723 723
724 WaitForCoalescense(); 724 WaitForCoalescense();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 content::NOTIFICATION_RENDERER_PROCESS_CREATED, 765 content::NOTIFICATION_RENDERER_PROCESS_CREATED,
766 content::Source<content::RenderProcessHost>(&different_process_host), 766 content::Source<content::RenderProcessHost>(&different_process_host),
767 content::NotificationService::NoDetails()); 767 content::NotificationService::NoDetails());
768 WaitForCoalescense(); 768 WaitForCoalescense();
769 769
770 EXPECT_EQ(0, different_context.new_table_count()); 770 EXPECT_EQ(0, different_context.new_table_count());
771 771
772 } 772 }
773 773
774 } // namespace visitedlink 774 } // namespace visitedlink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698