| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 "net_internals/net_internals_test.js"))); | 221 "net_internals/net_internals_test.js"))); |
| 222 | 222 |
| 223 // Add Javascript files needed for individual tests. | 223 // Add Javascript files needed for individual tests. |
| 224 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/dns_view.js"))); | 224 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/dns_view.js"))); |
| 225 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/hsts_view.js"))); | 225 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/hsts_view.js"))); |
| 226 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/log_util.js"))); | 226 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/log_util.js"))); |
| 227 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/log_view_painter.js"))); | 227 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/log_view_painter.js"))); |
| 228 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/main.js"))); | 228 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/main.js"))); |
| 229 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/prerender_view.js"))); | 229 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/prerender_view.js"))); |
| 230 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/test_view.js"))); | 230 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/test_view.js"))); |
| 231 AddLibrary(FilePath(FILE_PATH_LITERAL("net_internals/timeline_view.js"))); |
| 231 } | 232 } |
| 232 | 233 |
| 233 void NetInternalsTest::SetUpOnMainThread() { | 234 void NetInternalsTest::SetUpOnMainThread() { |
| 234 // Navigate to chrome://net-internals. | 235 // Navigate to chrome://net-internals. |
| 235 ui_test_utils::NavigateToURL(browser(), | 236 ui_test_utils::NavigateToURL(browser(), |
| 236 GURL(chrome::kChromeUINetInternalsURL)); | 237 GURL(chrome::kChromeUINetInternalsURL)); |
| 237 // Increase the memory allowed in a prerendered page above normal settings, | 238 // Increase the memory allowed in a prerendered page above normal settings, |
| 238 // as debug builds use more memory and often go over the usual limit. | 239 // as debug builds use more memory and often go over the usual limit. |
| 239 Profile* profile = browser()->GetSelectedTabContentsWrapper()->profile(); | 240 Profile* profile = browser()->GetSelectedTabContentsWrapper()->profile(); |
| 240 prerender::PrerenderManager* prerender_manager = | 241 prerender::PrerenderManager* prerender_manager = |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 // Checks exporting and importing a log dump, as well as some tab behavior in | 296 // Checks exporting and importing a log dump, as well as some tab behavior in |
| 296 // response to doing this. Does not actually save the log to a file, just | 297 // response to doing this. Does not actually save the log to a file, just |
| 297 // to a string. | 298 // to a string. |
| 298 // TODO(mmenke): Add some checks for the import view. | 299 // TODO(mmenke): Add some checks for the import view. |
| 299 // TODO(mmenke): Add a test for a log created with --log-net-log. | 300 // TODO(mmenke): Add a test for a log created with --log-net-log. |
| 300 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsExportImportDump) { | 301 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsExportImportDump) { |
| 301 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsExportImportDump")); | 302 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsExportImportDump")); |
| 302 } | 303 } |
| 303 | 304 |
| 304 //////////////////////////////////////////////////////////////////////////////// | 305 //////////////////////////////////////////////////////////////////////////////// |
| 306 // timeline_view.js |
| 307 //////////////////////////////////////////////////////////////////////////////// |
| 308 |
| 309 // TODO(mmenke): Add tests for labels and DataSeries. |
| 310 |
| 311 // Tests setting and updating range. |
| 312 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTimelineViewRange) { |
| 313 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsTimelineViewRange")); |
| 314 } |
| 315 |
| 316 // Tests using the scroll bar. |
| 317 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTimelineViewScrollbar) { |
| 318 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsTimelineViewScrollbar")); |
| 319 } |
| 320 |
| 321 // Tests case of having no events. |
| 322 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTimelineViewNoEvents) { |
| 323 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsTimelineViewNoEvents")); |
| 324 } |
| 325 |
| 326 // Dumps a log file to memory, modifies its events, loads it again, and |
| 327 // makes sure the range is correctly set and not automatically updated. |
| 328 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTimelineViewLoadLog) { |
| 329 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsTimelineViewLoadLog")); |
| 330 } |
| 331 |
| 332 // Zooms out twice, and then zooms in once. |
| 333 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTimelineViewZoomOut) { |
| 334 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsTimelineViewZoomOut")); |
| 335 } |
| 336 |
| 337 // Zooms in as much as allowed, and zooms out once. |
| 338 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTimelineViewZoomIn) { |
| 339 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsTimelineViewZoomIn")); |
| 340 } |
| 341 |
| 342 // Tests case of all events having the same time. |
| 343 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsTimelineViewDegenerate) { |
| 344 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsTimelineViewDegenerate")); |
| 345 } |
| 346 |
| 347 //////////////////////////////////////////////////////////////////////////////// |
| 305 // dns_view.js | 348 // dns_view.js |
| 306 //////////////////////////////////////////////////////////////////////////////// | 349 //////////////////////////////////////////////////////////////////////////////// |
| 307 | 350 |
| 308 // Adds a successful lookup to the DNS cache, then clears the cache. | 351 // Adds a successful lookup to the DNS cache, then clears the cache. |
| 309 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsDnsViewSuccess) { | 352 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsDnsViewSuccess) { |
| 310 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsDnsViewSuccess")); | 353 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsDnsViewSuccess")); |
| 311 } | 354 } |
| 312 | 355 |
| 313 // Adds a failed lookup to the DNS cache, then clears the cache. | 356 // Adds a failed lookup to the DNS cache, then clears the cache. |
| 314 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsDnsViewFail) { | 357 IN_PROC_BROWSER_TEST_F(NetInternalsTest, NetInternalsDnsViewFail) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // log_view_painter.js | 492 // log_view_painter.js |
| 450 //////////////////////////////////////////////////////////////////////////////// | 493 //////////////////////////////////////////////////////////////////////////////// |
| 451 | 494 |
| 452 // Check that we correctly remove cookies and login information. | 495 // Check that we correctly remove cookies and login information. |
| 453 IN_PROC_BROWSER_TEST_F(NetInternalsTest, | 496 IN_PROC_BROWSER_TEST_F(NetInternalsTest, |
| 454 NetInternalsLogViewPainterStripInfo) { | 497 NetInternalsLogViewPainterStripInfo) { |
| 455 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsLogViewPainterStripInfo")); | 498 EXPECT_TRUE(RunJavascriptAsyncTest("netInternalsLogViewPainterStripInfo")); |
| 456 } | 499 } |
| 457 | 500 |
| 458 } // namespace | 501 } // namespace |
| OLD | NEW |