OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 browser_context_.reset(new VisitCountingProfile()); | 586 browser_context_.reset(new VisitCountingProfile()); |
587 ChromeRenderViewHostTestHarness::SetUp(); | 587 ChromeRenderViewHostTestHarness::SetUp(); |
588 } | 588 } |
589 | 589 |
590 VisitCountingProfile* profile() const { | 590 VisitCountingProfile* profile() const { |
591 return static_cast<VisitCountingProfile*>(browser_context_.get()); | 591 return static_cast<VisitCountingProfile*>(browser_context_.get()); |
592 } | 592 } |
593 | 593 |
594 void WaitForCoalescense() { | 594 void WaitForCoalescense() { |
595 // Let the timer fire. | 595 // Let the timer fire. |
596 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 596 MessageLoop::current()->PostDelayedTask( |
597 MessageLoop::QuitClosure(), 110); | 597 FROM_HERE, |
| 598 MessageLoop::QuitClosure(), |
| 599 base::TimeDelta::FromMilliseconds(110)); |
598 MessageLoop::current()->Run(); | 600 MessageLoop::current()->Run(); |
599 } | 601 } |
600 | 602 |
601 protected: | 603 protected: |
602 VisitedLinkRenderProcessHostFactory vc_rph_factory_; | 604 VisitedLinkRenderProcessHostFactory vc_rph_factory_; |
603 | 605 |
604 private: | 606 private: |
605 content::TestBrowserThread ui_thread_; | 607 content::TestBrowserThread ui_thread_; |
606 content::TestBrowserThread file_thread_; | 608 content::TestBrowserThread file_thread_; |
607 | 609 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 EXPECT_EQ(1, profile()->add_event_count()); | 725 EXPECT_EQ(1, profile()->add_event_count()); |
724 EXPECT_EQ(0, profile()->reset_event_count()); | 726 EXPECT_EQ(0, profile()->reset_event_count()); |
725 | 727 |
726 // Activate the tab. | 728 // Activate the tab. |
727 rvh()->WasRestored(); | 729 rvh()->WasRestored(); |
728 | 730 |
729 // We should have only one more reset event. | 731 // We should have only one more reset event. |
730 EXPECT_EQ(1, profile()->add_event_count()); | 732 EXPECT_EQ(1, profile()->add_event_count()); |
731 EXPECT_EQ(1, profile()->reset_event_count()); | 733 EXPECT_EQ(1, profile()->reset_event_count()); |
732 } | 734 } |
OLD | NEW |