| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/login/login_prompt.h" | 11 #include "chrome/browser/ui/login/login_prompt.h" |
| 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
| 18 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
| 19 #include "content/public/browser/notification_details.h" | 19 #include "content/public/browser/notification_details.h" |
| 20 #include "content/public/browser/notification_source.h" | 20 #include "content/public/browser/notification_source.h" |
| 21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 22 #include "content/public/browser/web_contents_observer.h" | 22 #include "content/public/browser/web_contents_observer.h" |
| 23 #include "content/public/test/browser_test_utils.h" | 23 #include "content/public/test/browser_test_utils.h" |
| 24 #include "net/base/test_data_directory.h" | 24 #include "net/base/test_data_directory.h" |
| 25 #include "net/test/spawned_test_server.h" | 25 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // This class observes chrome::NOTIFICATION_AUTH_NEEDED and supplies | 29 // This class observes chrome::NOTIFICATION_AUTH_NEEDED and supplies |
| 30 // the credential which is required by the test proxy server. | 30 // the credential which is required by the test proxy server. |
| 31 // "foo:bar" is the required username and password for our test proxy server. | 31 // "foo:bar" is the required username and password for our test proxy server. |
| 32 class LoginPromptObserver : public content::NotificationObserver { | 32 class LoginPromptObserver : public content::NotificationObserver { |
| 33 public: | 33 public: |
| 34 LoginPromptObserver() : auth_handled_(false) {} | 34 LoginPromptObserver() : auth_handled_(false) {} |
| 35 | 35 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 ui_test_utils::NavigateToURL( | 117 ui_test_utils::NavigateToURL( |
| 118 browser(), | 118 browser(), |
| 119 ws_server.GetURL("connect_check.html").ReplaceComponents(replacements)); | 119 ws_server.GetURL("connect_check.html").ReplaceComponents(replacements)); |
| 120 | 120 |
| 121 const string16 result = watcher.WaitAndGetTitle(); | 121 const string16 result = watcher.WaitAndGetTitle(); |
| 122 EXPECT_TRUE(EqualsASCII(result, "PASS")); | 122 EXPECT_TRUE(EqualsASCII(result, "PASS")); |
| 123 EXPECT_TRUE(observer.auth_handled()); | 123 EXPECT_TRUE(observer.auth_handled()); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace | 126 } // namespace |
| OLD | NEW |