OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/prerender/prerender_final_status.h" | 8 #include "chrome/browser/prerender/prerender_final_status.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/webui/web_ui_browsertest.h" | 10 #include "chrome/browser/ui/webui/web_ui_browsertest.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 //////////////////////////////////////////////////////////////////////////////// | 229 //////////////////////////////////////////////////////////////////////////////// |
230 | 230 |
231 // Runs the test suite twice, expecting a passing result the first time. Checks | 231 // Runs the test suite twice, expecting a passing result the first time. Checks |
232 // the first result, the order of events that occur, and the number of rows in | 232 // the first result, the order of events that occur, and the number of rows in |
233 // the table. | 233 // the table. |
234 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTestViewPassTwice) { | 234 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTestViewPassTwice) { |
235 ASSERT_TRUE(test_server()->Start()); | 235 ASSERT_TRUE(test_server()->Start()); |
236 RunTestAndWaitForTitle( | 236 RunTestAndWaitForTitle( |
237 "NetInternalsTestView", | 237 "NetInternalsTestView", |
238 // URL that results in success. | 238 // URL that results in success. |
239 Value::CreateStringValue( | 239 base::StringValue::New( |
240 test_server()->GetURL("files/title1.html").spec()), | 240 test_server()->GetURL("files/title1.html").spec()), |
241 // Resulting error code of the first test. | 241 // Resulting error code of the first test. |
242 Value::CreateIntegerValue(net::OK), | 242 base::NumberValue::New(net::OK), |
243 // Number of times to run the test suite. | 243 // Number of times to run the test suite. |
244 Value::CreateIntegerValue(2)); | 244 base::NumberValue::New(2)); |
245 } | 245 } |
246 | 246 |
247 // Runs the test suite twice, expecting a failing result the first time. Checks | 247 // Runs the test suite twice, expecting a failing result the first time. Checks |
248 // the first result, the order of events that occur, and the number of rows in | 248 // the first result, the order of events that occur, and the number of rows in |
249 // the table. | 249 // the table. |
250 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTestViewFailTwice) { | 250 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTestViewFailTwice) { |
251 RunTestAndWaitForTitle( | 251 RunTestAndWaitForTitle( |
252 "NetInternalsTestView", | 252 "NetInternalsTestView", |
253 // URL that results in an error, due to the port. | 253 // URL that results in an error, due to the port. |
254 Value::CreateStringValue("http://127.0.0.1:7/"), | 254 base::StringValue::New("http://127.0.0.1:7/"), |
255 // Resulting error code of the first test. | 255 // Resulting error code of the first test. |
256 Value::CreateIntegerValue(net::ERR_UNSAFE_PORT), | 256 base::NumberValue::New(net::ERR_UNSAFE_PORT), |
257 // Number of times to run the test suite. | 257 // Number of times to run the test suite. |
258 Value::CreateIntegerValue(2)); | 258 base::NumberValue::New(2)); |
259 } | 259 } |
260 | 260 |
261 //////////////////////////////////////////////////////////////////////////////// | 261 //////////////////////////////////////////////////////////////////////////////// |
262 // prerender_view.js | 262 // prerender_view.js |
263 //////////////////////////////////////////////////////////////////////////////// | 263 //////////////////////////////////////////////////////////////////////////////// |
264 | 264 |
265 // Prerender a page and navigate to it, once prerendering starts. | 265 // Prerender a page and navigate to it, once prerendering starts. |
266 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsPrerenderViewSucceed) { | 266 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsPrerenderViewSucceed) { |
267 ASSERT_TRUE(test_server()->Start()); | 267 ASSERT_TRUE(test_server()->Start()); |
268 RunTestAndWaitForTitle( | 268 RunTestAndWaitForTitle( |
269 "NetInternalsPrerenderView", | 269 "NetInternalsPrerenderView", |
270 // URL that can be prerendered. | 270 // URL that can be prerendered. |
271 Value::CreateStringValue( | 271 base::StringValue::New( |
272 test_server()->GetURL("files/title1.html").spec()), | 272 test_server()->GetURL("files/title1.html").spec()), |
273 Value::CreateBooleanValue(true), | 273 base::TrueValue(), |
274 Value::CreateStringValue( | 274 base::StringValue::New( |
275 prerender::NameFromFinalStatus(prerender::FINAL_STATUS_USED))); | 275 prerender::NameFromFinalStatus(prerender::FINAL_STATUS_USED))); |
276 } | 276 } |
277 | 277 |
278 // Prerender a page that is expected to fail. | 278 // Prerender a page that is expected to fail. |
279 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsPrerenderViewFail) { | 279 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsPrerenderViewFail) { |
280 ASSERT_TRUE(test_server()->Start()); | 280 ASSERT_TRUE(test_server()->Start()); |
281 RunTestAndWaitForTitle( | 281 RunTestAndWaitForTitle( |
282 "NetInternalsPrerenderView", | 282 "NetInternalsPrerenderView", |
283 // URL that can't be prerendered, since it triggers a download. | 283 // URL that can't be prerendered, since it triggers a download. |
284 Value::CreateStringValue( | 284 base::StringValue::New( |
285 test_server()->GetURL("files/download-test1.lib").spec()), | 285 test_server()->GetURL("files/download-test1.lib").spec()), |
286 Value::CreateBooleanValue(false), | 286 base::FalseValue(), |
287 Value::CreateStringValue( | 287 base::StringValue::New( |
288 prerender::NameFromFinalStatus(prerender::FINAL_STATUS_DOWNLOAD))); | 288 prerender::NameFromFinalStatus(prerender::FINAL_STATUS_DOWNLOAD))); |
289 } | 289 } |
290 | 290 |
291 //////////////////////////////////////////////////////////////////////////////// | 291 //////////////////////////////////////////////////////////////////////////////// |
292 // log_view_painter.js | 292 // log_view_painter.js |
293 //////////////////////////////////////////////////////////////////////////////// | 293 //////////////////////////////////////////////////////////////////////////////// |
294 | 294 |
295 // Check that we correctly remove cookies and login information. | 295 // Check that we correctly remove cookies and login information. |
296 IN_PROC_BROWSER_TEST_F(NetInternalsTest, | 296 IN_PROC_BROWSER_TEST_F(NetInternalsTest, |
297 NetInternalsLogViewPainterStripInfo) { | 297 NetInternalsLogViewPainterStripInfo) { |
298 RunTestAndWaitForTitle("NetInternalsLogViewPainterStripInfo"); | 298 RunTestAndWaitForTitle("NetInternalsLogViewPainterStripInfo"); |
299 } | 299 } |
300 | 300 |
301 } // namespace | 301 } // namespace |
OLD | NEW |