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