| OLD | NEW |
| 1 // Copyright (c) 2012 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" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| (...skipping 571 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( | 593 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 594 FROM_HERE, | 594 MessageLoop::QuitClosure(), 110); |
| 595 MessageLoop::QuitClosure(), | |
| 596 base::TimeDelta::FromMilliseconds(110)); | |
| 597 MessageLoop::current()->Run(); | 595 MessageLoop::current()->Run(); |
| 598 } | 596 } |
| 599 | 597 |
| 600 protected: | 598 protected: |
| 601 VisitedLinkRenderProcessHostFactory vc_rph_factory_; | 599 VisitedLinkRenderProcessHostFactory vc_rph_factory_; |
| 602 | 600 |
| 603 private: | 601 private: |
| 604 content::TestBrowserThread ui_thread_; | 602 content::TestBrowserThread ui_thread_; |
| 605 content::TestBrowserThread file_thread_; | 603 content::TestBrowserThread file_thread_; |
| 606 | 604 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 EXPECT_EQ(1, profile()->add_event_count()); | 720 EXPECT_EQ(1, profile()->add_event_count()); |
| 723 EXPECT_EQ(0, profile()->reset_event_count()); | 721 EXPECT_EQ(0, profile()->reset_event_count()); |
| 724 | 722 |
| 725 // Activate the tab. | 723 // Activate the tab. |
| 726 rvh()->WasRestored(); | 724 rvh()->WasRestored(); |
| 727 | 725 |
| 728 // We should have only one more reset event. | 726 // We should have only one more reset event. |
| 729 EXPECT_EQ(1, profile()->add_event_count()); | 727 EXPECT_EQ(1, profile()->add_event_count()); |
| 730 EXPECT_EQ(1, profile()->reset_event_count()); | 728 EXPECT_EQ(1, profile()->reset_event_count()); |
| 731 } | 729 } |
| OLD | NEW |