| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <vector> | 5 #include <vector> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <cstdio> | 7 #include <cstdio> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 class VisitedLinkEventsTest : public RenderViewHostTestHarness { | 558 class VisitedLinkEventsTest : public RenderViewHostTestHarness { |
| 559 public: | 559 public: |
| 560 VisitedLinkEventsTest() : RenderViewHostTestHarness() {} | 560 VisitedLinkEventsTest() : RenderViewHostTestHarness() {} |
| 561 virtual void SetFactoryMode() {} | 561 virtual void SetFactoryMode() {} |
| 562 virtual void SetUp() { | 562 virtual void SetUp() { |
| 563 SetFactoryMode(); | 563 SetFactoryMode(); |
| 564 event_listener_.reset(new VisitedLinkEventListener()); | 564 event_listener_.reset(new VisitedLinkEventListener()); |
| 565 rvh_factory_.set_render_process_host_factory(&vc_rph_factory_); | 565 rvh_factory_.set_render_process_host_factory(&vc_rph_factory_); |
| 566 profile_.reset(new VisitCountingProfile(event_listener_.get())); | 566 profile_.reset(new VisitCountingProfile(event_listener_.get())); |
| 567 RenderViewHostTestHarness::SetUp(); | 567 RenderViewHostTestHarness::SetUp(); |
| 568 rvh()->CreateRenderView(); |
| 568 } | 569 } |
| 569 | 570 |
| 570 VisitCountingProfile* profile() const { | 571 VisitCountingProfile* profile() const { |
| 571 return static_cast<VisitCountingProfile*>(profile_.get()); | 572 return static_cast<VisitCountingProfile*>(profile_.get()); |
| 572 } | 573 } |
| 573 | 574 |
| 574 void WaitForCoalescense() { | 575 void WaitForCoalescense() { |
| 575 // Let the timer fire. | 576 // Let the timer fire. |
| 576 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 577 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 577 new MessageLoop::QuitTask(), 110); | 578 new MessageLoop::QuitTask(), 110); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 EXPECT_EQ(1, profile()->add_event_count()); | 705 EXPECT_EQ(1, profile()->add_event_count()); |
| 705 EXPECT_EQ(0, profile()->reset_event_count()); | 706 EXPECT_EQ(0, profile()->reset_event_count()); |
| 706 | 707 |
| 707 // Activate the tab. | 708 // Activate the tab. |
| 708 rvh()->WasRestored(); | 709 rvh()->WasRestored(); |
| 709 | 710 |
| 710 // We should have only one more reset event. | 711 // We should have only one more reset event. |
| 711 EXPECT_EQ(1, profile()->add_event_count()); | 712 EXPECT_EQ(1, profile()->add_event_count()); |
| 712 EXPECT_EQ(1, profile()->reset_event_count()); | 713 EXPECT_EQ(1, profile()->reset_event_count()); |
| 713 } | 714 } |
| OLD | NEW |