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

Side by Side Diff: chrome/browser/visitedlink/visitedlink_unittest.cc

Issue 10450002: Transfer user agent override info between browser and renderer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Diff shows what we do downstream Created 8 years, 7 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
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/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(), MSG_ROUTING_NONE, -1, -1); 655 rvh_tester()->CreateRenderView(string16(), MSG_ROUTING_NONE, -1, -1,
656 std::string());
656 657
657 // Add a few URLs. 658 // Add a few URLs.
658 master->AddURL(GURL("http://acidtests.org/")); 659 master->AddURL(GURL("http://acidtests.org/"));
659 master->AddURL(GURL("http://google.com/")); 660 master->AddURL(GURL("http://google.com/"));
660 master->AddURL(GURL("http://chromium.org/")); 661 master->AddURL(GURL("http://chromium.org/"));
661 662
662 WaitForCoalescense(); 663 WaitForCoalescense();
663 664
664 // We now should have 1 add event. 665 // We now should have 1 add event.
665 EXPECT_EQ(1, profile()->add_event_count()); 666 EXPECT_EQ(1, profile()->add_event_count());
666 EXPECT_EQ(0, profile()->reset_event_count()); 667 EXPECT_EQ(0, profile()->reset_event_count());
667 668
668 master->DeleteAllURLs(); 669 master->DeleteAllURLs();
669 670
670 WaitForCoalescense(); 671 WaitForCoalescense();
671 672
672 // We should have no change in add results, plus one new reset event. 673 // We should have no change in add results, plus one new reset event.
673 EXPECT_EQ(1, profile()->add_event_count()); 674 EXPECT_EQ(1, profile()->add_event_count());
674 EXPECT_EQ(1, profile()->reset_event_count()); 675 EXPECT_EQ(1, profile()->reset_event_count());
675 } 676 }
676 677
677 TEST_F(VisitedLinkEventsTest, TabVisibility) { 678 TEST_F(VisitedLinkEventsTest, TabVisibility) {
678 VisitedLinkMaster* master = profile()->GetVisitedLinkMaster(); 679 VisitedLinkMaster* master = profile()->GetVisitedLinkMaster();
679 rvh_tester()->CreateRenderView(string16(), MSG_ROUTING_NONE, -1, -1); 680 rvh_tester()->CreateRenderView(string16(), MSG_ROUTING_NONE, -1, -1,
681 std::string());
680 682
681 // Simulate tab becoming inactive. 683 // Simulate tab becoming inactive.
682 rvh_tester()->SimulateWasHidden(); 684 rvh_tester()->SimulateWasHidden();
683 685
684 // Add a few URLs. 686 // Add a few URLs.
685 master->AddURL(GURL("http://acidtests.org/")); 687 master->AddURL(GURL("http://acidtests.org/"));
686 master->AddURL(GURL("http://google.com/")); 688 master->AddURL(GURL("http://google.com/"));
687 master->AddURL(GURL("http://chromium.org/")); 689 master->AddURL(GURL("http://chromium.org/"));
688 690
689 WaitForCoalescense(); 691 WaitForCoalescense();
(...skipping 22 matching lines...) Expand all
712 EXPECT_EQ(1, profile()->add_event_count()); 714 EXPECT_EQ(1, profile()->add_event_count());
713 EXPECT_EQ(0, profile()->reset_event_count()); 715 EXPECT_EQ(0, profile()->reset_event_count());
714 716
715 // Activate the tab. 717 // Activate the tab.
716 rvh_tester()->SimulateWasRestored(); 718 rvh_tester()->SimulateWasRestored();
717 719
718 // We should have only one more reset event. 720 // We should have only one more reset event.
719 EXPECT_EQ(1, profile()->add_event_count()); 721 EXPECT_EQ(1, profile()->add_event_count());
720 EXPECT_EQ(1, profile()->reset_event_count()); 722 EXPECT_EQ(1, profile()->reset_event_count());
721 } 723 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698