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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, FormSubmission) { | 114 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, FormSubmission) { |
115 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL( | 115 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL( |
116 test_data_dir_.AppendASCII("client_redirects.html"))); | 116 test_data_dir_.AppendASCII("client_redirects.html"))); |
117 | 117 |
118 MockNotificationObserver mock_notification_observer; | 118 MockNotificationObserver mock_notification_observer; |
119 MockTabEventObserver mock_observer(tab_helper()); | 119 MockTabEventObserver mock_observer(tab_helper()); |
120 | 120 |
121 ExpectClientRedirectAndBreak(&mock_observer, &mock_notification_observer); | 121 ExpectClientRedirectAndBreak(&mock_observer, &mock_notification_observer); |
122 | 122 |
123 ASSERT_NO_FATAL_FAILURE(RunTestCaseInJavaScript(1, false)); | 123 ASSERT_NO_FATAL_FAILURE(RunTestCaseInJavaScript(1, false)); |
124 ui_test_utils::RunMessageLoop(); | 124 content::RunMessageLoop(); |
125 } | 125 } |
126 | 126 |
127 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, | 127 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, |
128 CancelFormSubmission) { | 128 CancelFormSubmission) { |
129 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL( | 129 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL( |
130 test_data_dir_.AppendASCII("client_redirects.html"))); | 130 test_data_dir_.AppendASCII("client_redirects.html"))); |
131 | 131 |
132 MockNotificationObserver mock_notification_observer; | 132 MockNotificationObserver mock_notification_observer; |
133 MockTabEventObserver mock_observer(tab_helper()); | 133 MockTabEventObserver mock_observer(tab_helper()); |
134 | 134 |
135 testing::InSequence expect_in_sequence; | 135 testing::InSequence expect_in_sequence; |
136 EXPECT_CALL(mock_observer, OnFirstPendingLoad(_)).Times(0); | 136 EXPECT_CALL(mock_observer, OnFirstPendingLoad(_)).Times(0); |
137 | 137 |
138 ASSERT_NO_FATAL_FAILURE(RunTestCaseInJavaScript(2, true)); | 138 ASSERT_NO_FATAL_FAILURE(RunTestCaseInJavaScript(2, true)); |
139 } | 139 } |
140 | 140 |
141 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, | 141 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, |
142 JsRedirectToSite) { | 142 JsRedirectToSite) { |
143 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL( | 143 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL( |
144 test_data_dir_.AppendASCII("client_redirects.html"))); | 144 test_data_dir_.AppendASCII("client_redirects.html"))); |
145 | 145 |
146 MockNotificationObserver mock_notification_observer; | 146 MockNotificationObserver mock_notification_observer; |
147 MockTabEventObserver mock_observer(tab_helper()); | 147 MockTabEventObserver mock_observer(tab_helper()); |
148 | 148 |
149 ExpectClientRedirectAndBreak(&mock_observer, &mock_notification_observer); | 149 ExpectClientRedirectAndBreak(&mock_observer, &mock_notification_observer); |
150 | 150 |
151 ASSERT_NO_FATAL_FAILURE(RunTestCaseInJavaScript(3, false)); | 151 ASSERT_NO_FATAL_FAILURE(RunTestCaseInJavaScript(3, false)); |
152 ui_test_utils::RunMessageLoop(); | 152 content::RunMessageLoop(); |
153 } | 153 } |
154 | 154 |
155 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, | 155 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, |
156 JsRedirectToUnknownSite) { | 156 JsRedirectToUnknownSite) { |
157 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL( | 157 ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL( |
158 test_data_dir_.AppendASCII("client_redirects.html"))); | 158 test_data_dir_.AppendASCII("client_redirects.html"))); |
159 | 159 |
160 MockNotificationObserver mock_notification_observer; | 160 MockNotificationObserver mock_notification_observer; |
161 MockTabEventObserver mock_observer(tab_helper()); | 161 MockTabEventObserver mock_observer(tab_helper()); |
162 | 162 |
163 ExpectClientRedirectAndBreak(&mock_observer, &mock_notification_observer); | 163 ExpectClientRedirectAndBreak(&mock_observer, &mock_notification_observer); |
164 | 164 |
165 ASSERT_NO_FATAL_FAILURE(RunTestCaseInJavaScript(4, false)); | 165 ASSERT_NO_FATAL_FAILURE(RunTestCaseInJavaScript(4, false)); |
166 ui_test_utils::RunMessageLoop(); | 166 content::RunMessageLoop(); |
167 } | 167 } |
168 | 168 |
169 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, | 169 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, |
170 MetaTagRedirect) { | 170 MetaTagRedirect) { |
171 MockTabEventObserver mock_observer(tab_helper()); | 171 MockTabEventObserver mock_observer(tab_helper()); |
172 | 172 |
173 testing::InSequence expect_in_sequence; | 173 testing::InSequence expect_in_sequence; |
174 EXPECT_CALL(mock_observer, OnFirstPendingLoad(_)); | 174 EXPECT_CALL(mock_observer, OnFirstPendingLoad(_)); |
175 EXPECT_CALL(mock_observer, OnNoMorePendingLoads(_)); | 175 EXPECT_CALL(mock_observer, OnNoMorePendingLoads(_)); |
176 | 176 |
(...skipping 30 matching lines...) Expand all Loading... |
207 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, | 207 IN_PROC_BROWSER_TEST_F(AutomationTabHelperBrowserTest, |
208 CrashedTabStopsLoading) { | 208 CrashedTabStopsLoading) { |
209 MockTabEventObserver mock_tab_observer(tab_helper()); | 209 MockTabEventObserver mock_tab_observer(tab_helper()); |
210 | 210 |
211 testing::InSequence expect_in_sequence; | 211 testing::InSequence expect_in_sequence; |
212 EXPECT_CALL(mock_tab_observer, OnFirstPendingLoad(_)); | 212 EXPECT_CALL(mock_tab_observer, OnFirstPendingLoad(_)); |
213 EXPECT_CALL(mock_tab_observer, OnNoMorePendingLoads(_)); | 213 EXPECT_CALL(mock_tab_observer, OnNoMorePendingLoads(_)); |
214 | 214 |
215 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUICrashURL)); | 215 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUICrashURL)); |
216 } | 216 } |
OLD | NEW |