Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc

Issue 1347043002: Move ChromeNetLog to //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/files/file_util.h" 11 #include "base/files/file_util.h"
12 #include "base/files/scoped_file.h" 12 #include "base/files/scoped_file.h"
13 #include "base/prefs/pref_service.h" 13 #include "base/prefs/pref_service.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/io_thread.h" 18 #include "chrome/browser/io_thread.h"
19 #include "chrome/browser/net/chrome_net_log.h"
20 #include "chrome/browser/prerender/prerender_manager.h" 19 #include "chrome/browser/prerender/prerender_manager.h"
21 #include "chrome/browser/prerender/prerender_manager_factory.h" 20 #include "chrome/browser/prerender/prerender_manager_factory.h"
22 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
24 #include "chrome/browser/ui/tabs/tab_strip_model.h" 23 #include "chrome/browser/ui/tabs/tab_strip_model.h"
25 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" 24 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
25 #include "chrome/common/channel_info.h"
26 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
27 #include "chrome/test/base/ui_test_utils.h" 27 #include "chrome/test/base/ui_test_utils.h"
28 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_ names.h" 28 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_ names.h"
29 #include "components/net_log/chrome_net_log.h"
29 #include "content/public/browser/render_frame_host.h" 30 #include "content/public/browser/render_frame_host.h"
30 #include "content/public/browser/web_contents.h" 31 #include "content/public/browser/web_contents.h"
31 #include "content/public/browser/web_ui_message_handler.h" 32 #include "content/public/browser/web_ui_message_handler.h"
32 #include "net/base/address_list.h" 33 #include "net/base/address_list.h"
33 #include "net/base/net_errors.h" 34 #include "net/base/net_errors.h"
34 #include "net/dns/host_cache.h" 35 #include "net/dns/host_cache.h"
35 #include "net/dns/host_resolver.h" 36 #include "net/dns/host_resolver.h"
36 #include "net/dns/mock_host_resolver.h" 37 #include "net/dns/mock_host_resolver.h"
37 #include "net/http/http_network_session.h" 38 #include "net/http/http_network_session.h"
38 #include "net/http/http_transaction_factory.h" 39 #include "net/http/http_transaction_factory.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 void NetInternalsTest::MessageHandler::GetNetLogFileContents( 275 void NetInternalsTest::MessageHandler::GetNetLogFileContents(
275 const base::ListValue* list_value) { 276 const base::ListValue* list_value) {
276 base::ScopedTempDir temp_directory; 277 base::ScopedTempDir temp_directory;
277 ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); 278 ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
278 base::FilePath temp_file; 279 base::FilePath temp_file;
279 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_directory.path(), 280 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_directory.path(),
280 &temp_file)); 281 &temp_file));
281 base::ScopedFILE temp_file_handle(base::OpenFile(temp_file, "w")); 282 base::ScopedFILE temp_file_handle(base::OpenFile(temp_file, "w"));
282 ASSERT_TRUE(temp_file_handle); 283 ASSERT_TRUE(temp_file_handle);
283 284
284 scoped_ptr<base::Value> constants(NetInternalsUI::GetConstants()); 285 scoped_ptr<base::Value> constants(net_log::ChromeNetLog::GetConstants(
286 base::CommandLine::ForCurrentProcess()->GetCommandLineString(),
287 chrome::GetChannelString()));
285 scoped_ptr<net::WriteToFileNetLogObserver> net_log_logger( 288 scoped_ptr<net::WriteToFileNetLogObserver> net_log_logger(
286 new net::WriteToFileNetLogObserver()); 289 new net::WriteToFileNetLogObserver());
287 net_log_logger->StartObserving( 290 net_log_logger->StartObserving(
288 g_browser_process->net_log(), temp_file_handle.Pass(), constants.get(), 291 g_browser_process->net_log(), temp_file_handle.Pass(), constants.get(),
289 nullptr); 292 nullptr);
290 g_browser_process->net_log()->AddGlobalEntry( 293 g_browser_process->net_log()->AddGlobalEntry(
291 net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED); 294 net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED);
292 net::BoundNetLog bound_net_log = net::BoundNetLog::Make( 295 net::BoundNetLog bound_net_log = net::BoundNetLog::Make(
293 g_browser_process->net_log(), 296 g_browser_process->net_log(),
294 net::NetLog::SOURCE_URL_REQUEST); 297 net::NetLog::SOURCE_URL_REQUEST);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 if (test_server_started_) 368 if (test_server_started_)
366 return true; 369 return true;
367 test_server_started_ = test_server()->Start(); 370 test_server_started_ = test_server()->Start();
368 371
369 // Sample domain for SDCH-view test. Dictionaries for localhost/127.0.0.1 372 // Sample domain for SDCH-view test. Dictionaries for localhost/127.0.0.1
370 // are forbidden. 373 // are forbidden.
371 host_resolver()->AddRule("testdomain.com", "127.0.0.1"); 374 host_resolver()->AddRule("testdomain.com", "127.0.0.1");
372 host_resolver()->AddRule("sub.testdomain.com", "127.0.0.1"); 375 host_resolver()->AddRule("sub.testdomain.com", "127.0.0.1");
373 return test_server_started_; 376 return test_server_started_;
374 } 377 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698