OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Unit test for WebProgressNotifier class. | 5 // Unit test for WebProgressNotifier class. |
6 #include "ceee/ie/plugin/bho/web_progress_notifier.h" | 6 #include "ceee/ie/plugin/bho/web_progress_notifier.h" |
7 | 7 |
8 #include "ceee/ie/plugin/bho/web_browser_events_source.h" | 8 #include "ceee/ie/plugin/bho/web_browser_events_source.h" |
9 #include "ceee/ie/plugin/bho/window_message_source.h" | 9 #include "ceee/ie/plugin/bho/window_message_source.h" |
10 #include "ceee/ie/testing/mock_broker_and_friends.h" | 10 #include "ceee/ie/testing/mock_broker_and_friends.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 class TestWebProgressNotifier : public WebProgressNotifier { | 100 class TestWebProgressNotifier : public WebProgressNotifier { |
101 public: | 101 public: |
102 TestWebProgressNotifier() | 102 TestWebProgressNotifier() |
103 : mock_is_forward_back_(false), | 103 : mock_is_forward_back_(false), |
104 mock_in_onload_event_(false), | 104 mock_in_onload_event_(false), |
105 mock_is_meta_refresh_(false), | 105 mock_is_meta_refresh_(false), |
106 mock_has_potential_javascript_redirect_(false), | 106 mock_has_potential_javascript_redirect_(false), |
107 mock_is_possible_user_action_in_content_window_(false), | 107 mock_is_possible_user_action_in_content_window_(false), |
108 mock_is_possible_user_action_in_browser_ui_(false) {} | 108 mock_is_possible_user_action_in_browser_ui_(false) {} |
109 | 109 |
110 virtual WebNavigationEventsFunnel& webnavigation_events_funnel() { | 110 virtual WebNavigationEventsFunnel* webnavigation_events_funnel() { |
111 return mock_webnavigation_events_funnel_; | 111 return &mock_webnavigation_events_funnel_; |
112 } | 112 } |
113 | 113 |
114 virtual WindowMessageSource* CreateWindowMessageSource() { | 114 virtual WindowMessageSource* CreateWindowMessageSource() { |
115 return new FakeWindowMessageSource(); | 115 return new FakeWindowMessageSource(); |
116 } | 116 } |
117 | 117 |
118 virtual bool IsForwardBack(BSTR /*url*/) { return mock_is_forward_back_; } | 118 virtual bool IsForwardBack(BSTR /*url*/) { return mock_is_forward_back_; } |
119 virtual bool InOnLoadEvent(IWebBrowser2* /*browser*/) { | 119 virtual bool InOnLoadEvent(IWebBrowser2* /*browser*/) { |
120 return mock_in_onload_event_; | 120 return mock_in_onload_event_; |
121 } | 121 } |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 // last entry in the list remains the same, the navigation is forward/back. | 584 // last entry in the list remains the same, the navigation is forward/back. |
585 EXPECT_TRUE(web_progress_notifier_->CallRealIsForwardBack(google_url)); | 585 EXPECT_TRUE(web_progress_notifier_->CallRealIsForwardBack(google_url)); |
586 check.Call(4); | 586 check.Call(4); |
587 | 587 |
588 // If the length of the forward/back list remains the same, but the URL of the | 588 // If the length of the forward/back list remains the same, but the URL of the |
589 // last entry in the list has changed, the navigation is not forward/back. | 589 // last entry in the list has changed, the navigation is not forward/back. |
590 EXPECT_FALSE(web_progress_notifier_->CallRealIsForwardBack(gmail_url)); | 590 EXPECT_FALSE(web_progress_notifier_->CallRealIsForwardBack(gmail_url)); |
591 } | 591 } |
592 | 592 |
593 } // namespace | 593 } // namespace |
OLD | NEW |