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 "chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h" | 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 g_browser_process->net_log()->AddGlobalEntry( | 352 g_browser_process->net_log()->AddGlobalEntry( |
353 net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED); | 353 net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED); |
354 net::BoundNetLog bound_net_log = net::BoundNetLog::Make( | 354 net::BoundNetLog bound_net_log = net::BoundNetLog::Make( |
355 g_browser_process->net_log(), | 355 g_browser_process->net_log(), |
356 net::NetLog::SOURCE_URL_REQUEST); | 356 net::NetLog::SOURCE_URL_REQUEST); |
357 bound_net_log.BeginEvent(net::NetLog::TYPE_REQUEST_ALIVE); | 357 bound_net_log.BeginEvent(net::NetLog::TYPE_REQUEST_ALIVE); |
358 net_log_logger->StopObserving(); | 358 net_log_logger->StopObserving(); |
359 net_log_logger.reset(); | 359 net_log_logger.reset(); |
360 | 360 |
361 std::string log_contents; | 361 std::string log_contents; |
362 ASSERT_TRUE(file_util::ReadFileToString(temp_file, &log_contents)); | 362 ASSERT_TRUE(base::ReadFileToString(temp_file, &log_contents)); |
363 ASSERT_GT(log_contents.length(), 0u); | 363 ASSERT_GT(log_contents.length(), 0u); |
364 | 364 |
365 scoped_ptr<Value> log_contents_value(new base::StringValue(log_contents)); | 365 scoped_ptr<Value> log_contents_value(new base::StringValue(log_contents)); |
366 RunJavascriptCallback(log_contents_value.get()); | 366 RunJavascriptCallback(log_contents_value.get()); |
367 } | 367 } |
368 | 368 |
369 //////////////////////////////////////////////////////////////////////////////// | 369 //////////////////////////////////////////////////////////////////////////////// |
370 // NetInternalsTest | 370 // NetInternalsTest |
371 //////////////////////////////////////////////////////////////////////////////// | 371 //////////////////////////////////////////////////////////////////////////////// |
372 | 372 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 GURL url_loader = test_server()->GetURL(replacement_path); | 425 GURL url_loader = test_server()->GetURL(replacement_path); |
426 return url_loader; | 426 return url_loader; |
427 } | 427 } |
428 | 428 |
429 bool NetInternalsTest::StartTestServer() { | 429 bool NetInternalsTest::StartTestServer() { |
430 if (test_server_started_) | 430 if (test_server_started_) |
431 return true; | 431 return true; |
432 test_server_started_ = test_server()->Start(); | 432 test_server_started_ = test_server()->Start(); |
433 return test_server_started_; | 433 return test_server_started_; |
434 } | 434 } |
OLD | NEW |