| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <list> | 6 #include <list> |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/prerender/prerender_manager.h" | 10 #include "chrome/browser/prerender/prerender_manager.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 void LoginPromptBrowserTestObserver::Register( | 157 void LoginPromptBrowserTestObserver::Register( |
| 158 const content::NotificationSource& source) { | 158 const content::NotificationSource& source) { |
| 159 registrar_.Add(this, chrome::NOTIFICATION_AUTH_NEEDED, source); | 159 registrar_.Add(this, chrome::NOTIFICATION_AUTH_NEEDED, source); |
| 160 registrar_.Add(this, chrome::NOTIFICATION_AUTH_SUPPLIED, source); | 160 registrar_.Add(this, chrome::NOTIFICATION_AUTH_SUPPLIED, source); |
| 161 registrar_.Add(this, chrome::NOTIFICATION_AUTH_CANCELLED, source); | 161 registrar_.Add(this, chrome::NOTIFICATION_AUTH_CANCELLED, source); |
| 162 } | 162 } |
| 163 | 163 |
| 164 template <int T> | 164 template <int T> |
| 165 class WindowedNavigationObserver | 165 class WindowedNavigationObserver |
| 166 : public ui_test_utils::WindowedNotificationObserver { | 166 : public content::WindowedNotificationObserver { |
| 167 public: | 167 public: |
| 168 explicit WindowedNavigationObserver(NavigationController* controller) | 168 explicit WindowedNavigationObserver(NavigationController* controller) |
| 169 : ui_test_utils::WindowedNotificationObserver( | 169 : content::WindowedNotificationObserver( |
| 170 T, content::Source<NavigationController>(controller)) {} | 170 T, content::Source<NavigationController>(controller)) {} |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 // LOAD_STOP observer is special since we want to be able to wait for | 173 // LOAD_STOP observer is special since we want to be able to wait for |
| 174 // multiple LOAD_STOP events. | 174 // multiple LOAD_STOP events. |
| 175 class WindowedLoadStopObserver | 175 class WindowedLoadStopObserver |
| 176 : public WindowedNavigationObserver<content::NOTIFICATION_LOAD_STOP> { | 176 : public WindowedNavigationObserver<content::NOTIFICATION_LOAD_STOP> { |
| 177 public: | 177 public: |
| 178 WindowedLoadStopObserver(NavigationController* controller, | 178 WindowedLoadStopObserver(NavigationController* controller, |
| 179 int notification_count) | 179 int notification_count) |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 EXPECT_EQ(1, observer.auth_needed_count_); | 1002 EXPECT_EQ(1, observer.auth_needed_count_); |
| 1003 EXPECT_EQ(1, observer.auth_supplied_count_); | 1003 EXPECT_EQ(1, observer.auth_supplied_count_); |
| 1004 EXPECT_EQ(0, observer.auth_cancelled_count_); | 1004 EXPECT_EQ(0, observer.auth_cancelled_count_); |
| 1005 EXPECT_EQ(1, observer_incognito.auth_needed_count_); | 1005 EXPECT_EQ(1, observer_incognito.auth_needed_count_); |
| 1006 EXPECT_EQ(0, observer_incognito.auth_supplied_count_); | 1006 EXPECT_EQ(0, observer_incognito.auth_supplied_count_); |
| 1007 EXPECT_EQ(0, observer_incognito.auth_cancelled_count_); | 1007 EXPECT_EQ(0, observer_incognito.auth_cancelled_count_); |
| 1008 EXPECT_TRUE(test_server()->Stop()); | 1008 EXPECT_TRUE(test_server()->Stop()); |
| 1009 } | 1009 } |
| 1010 | 1010 |
| 1011 } // namespace | 1011 } // namespace |
| OLD | NEW |